Contributions are welcome! Feel free to submit an issue to check to see if you want to start working on a feature but aren't sure if it will be accepted.
Run ./compile_and_move.sh
. (You only need to do this if you've changed the code) This updates solarthing.jar.
When you submit changes, you should make sure you follow conventions. Most of the time you should test your changes.
If the .gitignore
file needs something added to it, please add it at the bottom.
This project requires Java 8+. However, Java 8 API additions aren't used in the core
module to remain compatible with Android SDK level 19.
This does not apply to the client
module.
You can set your editor up with Editor Config to work with the .editorconfig file
- Use 1 tab for indentation
- 2 tabs for a continuation indent
Use standard Java naming conventions. Use myCoolId
instead of myCoolID
and use myCoolDb
instead of myCoolDB
.
Exceptions:
myIODevice
notmyIoDevice
myPVCurrent
notmyPvCurrent
myKWH
notmyKwh
myAH
notmyAh
- There may be more exceptions already present
Although I wish that some of these conventions could be changed, changing them would result in confusion and more inconsistencies.
if(true){ // OK
}
if (true) { // OK
}
if (true){ // OK
}
if(true) { // OK
}
Any of those styles will work. You will see throughout the code that it is pretty inconsistent. This is because I don't have a preference and I don't really notice much of a difference.
But...
if( true ){ // NOT OK
}
General rule of thumb:
- Do not use Nullable and NotNull religiously.
- If something is Nullable, you should probably annotate it with Nullable.
- Just because something is NotNull doesn't mean you need to annotate it and everything else with NotNull.
- But if something is commonly used (public api), then annotating with NotNull can be helpful.
- Use
me.retrodaredevil.solarthing.annotations.Nullable
orme.retrodaredevil.solarthing.annotations.NotNull
- Why the custom NotNull/Nullable? We want good Kotlin support, and we want to be able to annotate more than just methods.
The different command line options give you may ways to receive data and export data. CouchDB and InfluxDB are both supported.
If you want to store data in another database, you can create your own implementation of PacketHandler
If your implementation is general enough, submit a pull request so others can use your implementation as well!
Questions? Bugs? Comments? Visit our issues page!