New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable and disable logics #108
Conversation
…ic if flag is False - add enable() and disable() method to logic
- show current status in logic listing command "lo"/"ll"
…o enable/disable logic in visu
Conflicts: plugins/cli/README.md plugins/cli/__init__.py
parameters are specified; currently only "name" is required
will try to review this some day this week, as i highly need that PR for myself |
Just to quote myself (from the original issue):
Using the scheduler's active flag instead would completely remove the logic execution/trigger (which would be better since it is not anymore in the task/run queue of the scheduler) but needs more coupling between scheduler and logic class (because enabling/disabling would require a The current implementation triggers the logic in any case (enabled or disabled) and will just skip the actual logic execution. I'm still not sure which is the best implementation. So suggestions are welcome! |
(copied from mknx/smarthome#137)
In some cases it makes sense to temporarily disable a given logic and enable later again. At least I would like to disable some logics for some days but enable it again later. And I don't want to comment out the logic and restart SmartHome.py.
This patch contains the following enhancements:
logic.enable()
andlogic.disable()
logic.enabled
propertyel
anddl
CLI commandsll
CLI command{ "cmd" : "logic", "name" : "<name>", "enabled" : 0/1 }
- theval
attribute can also be specified to additionally trigger the logic, as this is the current behaviour)