pijuice_sys re-implementation#583
Conversation
69fcf4d to
5c3589f
Compare
5c3589f to
06af672
Compare
|
@betaboon thanks very much for your hard work on this code and supporting the project. Much appreciated! Myself and @tvoverbeek and @ryanteck will take a closer look :-) |
|
@betaboon I was wondering if perhaps it might be better to combine the functionality of pijuice_util.py and your pijuice_cmd into a single command line utility? https://github.com/PiSupply/PiJuice/blob/master/Software/Source/Utilities/pijuice_util.py As this is quite a major change, I'm thinking to perhaps merge your changes into a new I guess we will need to develop / change some of the documentation which I guess we should do before merging to master branch. The other thing I noticed is, was there a particular reason you used decimal numbering for the I2C address? I.e you have it 20 default instead of 0x14? I think having it as hex might be easier to understand perhaps. Of the non backward compatible changes you mentioned, the only one that seems to potentially break people's existing setups is this one:
Do you think there's a way to have it handle both commands and file paths? I would rather not break people's existing setups if it can be avoided. Lastly, when installing this as a deb over an existing install does this require any tidying up etc? |
|
FYI @mmilann also |
Hello Pijuice-team,
since i had several problems integrating
pijuice_syson non-raspbian distributions i figured i could reimplement pijuice_sys and add several improvements on how things work.i think this PR might help with multiple open issues and feature-requests as well.
this PR includes several things:
changes to
setup.pysetuptoolsallows explicit definition of dependenciessetuptoolsallows the definition ofentry_pointsto better separate implementation and the name of a command when installedfunctools.partialallows better separation of settings that are common topijuice-baseandpijuice-guiand of settings that are different, making the file more readable and maintainablepijuice_cmdallows shell access to
wakeup-on-charge,system-power-switch,power-offandled-blink.it is used in the new system-function-scripts and can be used in user-function-scripts.
pijuice_sys-reimplementationmarshmallowto define proper schemas for the configuration file to allow validation.HALT_FILEsystemd-service changes
the systemd-service is now seperated into
pijuiceandpijuice-poweroff.pijuice-poweroffis started when the system is being shutdown.general notes
i tried to make this a drop-in replacement as much as possible.
the only changes that are not backward compatible:
pijuice_sysUSER_FUNCXnow MUST be the path of a file and cannot be a command itself.SYS_FUNC_HALTandSYS_FUNC_HALT_POW_OFFnow executessystemctl poweroffinstead ofhaltas i think this is more appropriateanyway, that's it.
let me know of you have any thoughts on this, any requests etc.