-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
Adding a state machine to sensors will help in keeping track of any changes in sensors.
This will also help in reporting these to a status/<sensor-name> in the pub sub system similar to #5 .
State machine libraries for py-
Custom Implementation -
- https://python-3-patterns-idioms-test.readthedocs.io/en/latest/StateMachine.html
- https://dev.to/karn/building-a-simple-state-machine-in-python
- https://www.python-course.eu/finite_state_machine.php
EDIT- A really simple way would be using http://liftoff.github.io/onoff/
EDIT 2 - Nice tutorial using the python-statemachine library -- https://www.askpython.com/python-modules/state-machines-python
### Tasks
- [x] Read the code and understand what needs to be changed and come up with an plan for implementation. Only the python module is involved in this currently.
- [x] Add new abstract functions in the sensor class to expose the states
- [ ] Add states that a sensor can use.
- [ ] Push sensor states when a state change happens (can also use pull using functions above)
- [ ] Publish to the pub/sub broker using Publisher, similar to the way other data is published.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers
Type
Projects
Status
In Progress