Skip to content

Commit

Permalink
outline of how to add new component
Browse files Browse the repository at this point in the history
The outline is more clean than before but still lacks precise
information. Will need to double check if all the appropriate steps are
there and get the specific information.
  • Loading branch information
SwindleA committed Oct 2, 2023
1 parent 9434c36 commit ef4eb30
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
40 changes: 23 additions & 17 deletions micronautpi4j-utils/src/docs/asciidoc/contribute/newComponent.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,38 @@ https://github.com/oss-slu/Pi4Micronaut/edit/develop/micronautpi4j-utils/src/doc

TODO: add info on how to add a new component

NOTE: helper and controller are just micronaut framework practices, might not need to include exact details, may just reference a user to the micronaut documentation.
If its compatible with a Raspberry Pi then it should work well with the Pi4Micronaut framework. The following steps should encompass how most components are added to the framework, but should more or different steps be needed, use the
https://github.com/oss-slu/Pi4Micronaut/edit/develop/micronautpi4j-utils/src/docs/asciidoc/contribute/newComponent.adoc[Improve this doc] link to suggest changes.

* controller
** controls the component
** `components\src\main\java\com\opensourcewithslu\components\controllers`

include::exampleController.java[tag=ex]
TODO: helper and controller are just micronaut framework practices, might not need to include exact details, may just reference a user to the micronaut documentation.


* helper
** where all the actions are defined.
** `micronautpi4j-utils\src\main\java\com\opensourcewithslu`
1. Determine if the device is Input or Output:
** (TODO: find better definition of what an input device is)input devices main task is taking in information
** (TODO: find better definition of what an output device is) output devices display or output information

* input versus output device
** input devices main task is taking in information
*** `micronautpi4j-utils\src\main\java\com\opensourcewithslu\inputdevices`
** output devices display or output information
*** `micronautpi4j-utils\src\main\java\com\opensourcewithslu\outputdevices`

2. Create a Controller:
** TODO: define what a controller is and reference the Micronaut documentation
** (TODO: better describe the code base structure)
Where the controllers go:
`components\src\main\java\com\opensourcewithslu\components\controllers`
//include::exampleController.java[tag=ex]
3. Create a Helper:
** TODO: define what a helper does and reference the micronaut documentation
** (TODO: better describe the code base structure)
Where the helpers go: `micronautpi4j-utils\src\main\java\com\opensourcewithslu`\ (inputdevices or outputdevices)
4. Add Component to the Application yml
** TODO: explain the purpose of the yml file and what parameters each component will need to have, it will presumably be different for each component type.
## Adding components to the application yml
** Each component will need to be added to the application yml found at `components\src\main\resources\application.yml`.
TODO: explain the purpose of the yml file and what parameters each component will need to have, it will presumably be different for each component type.

Each component will need to be added to the application yml found at `components\src\main\resources\application.yml`.
5. Thoroughly test:
** Contributors should thoroughly test their integrations
** When submitting a pull request, make sure to include the circuit setup you used and the steps you took to setup the example that you used for testing.
** It is important that reviewers are able to replicated your work in order to properly test the implementation.
4 changes: 4 additions & 0 deletions micronautpi4j-utils/src/docs/asciidoc/howContribute.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ https://github.com/oss-slu/Pi4Micronaut/edit/develop/micronautpi4j-utils/src/doc

TODO: outline how someone can contribute to our library

There are several ways to contribute to the Pi4Micronaut framework, such as, suggesting changes to the code or documentation, bug fixes, or adding new components. Familiarity with the Micronaut framework will greatly help potential contributors understanding of how the code base works or how to implement new components. If help is needed with Micronaut related issues, reference the https://micronaut-projects.github.io/micronaut-docs-mn3/3.8.1/guide/[Micronaut Documentation] and the https://github.com/micronaut-projects/micronaut-core[Micronaut GitHub].



include::contribute/newComponent.adoc[]

0 comments on commit ef4eb30

Please sign in to comment.