Skip to content
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

Disable / enable logics #137

Closed
wants to merge 5 commits into from
Closed

Conversation

ohinckel
Copy link

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:

  • enable and disable logics with logic.enable() and logic.disable()
  • check enabled status with logic.enabled property
  • enable and disable logic using el and dl CLI commands
  • show if logic is disabled when using ll CLI command
  • add posibility to enable and disable logics via visu plugin (using { "cmd" : "logic", "name" : "<name>", "enabled" : 0/1 } - the val attribute can also be specified to additionally trigger the logic, as this is the current behaviour)

@ohinckel
Copy link
Author

I just saw, that the scheduler has already an ˋactiveˋ flag for all tasks. Since each (cron/cycle) logic is a task in the scheduler we can use this instead of using an own flag in the logic object.

If possible this patch can be changed to retrieve the ˋactiveˋ flag from the scheduler for a given logic to show it enabled or disabled. The methods to change the flag could simply tell the scheduler to activate or deactivate the logic task.

But I'm not sure if this is a clean solution. Suggestions and ideas are welcome.

@JuMi2006
Copy link
Collaborator

I would like this feature very much. But can`t say anything about quality of code.

Am 27.12.2014 um 21:46 schrieb ohinckel notifications@github.com:

I just saw, that the scheduler has already an ˋactiveˋ flag for all tasks. Since each (cron/cycle) logic is a task in the scheduler we can use this instead of using an own flag in the logic object.

If possible this patch can be changed to retrieve the ˋactiveˋ flag from the scheduler for a given logic to show it enabled or disabled. The methods to change the flag could simply tell the scheduler to activate or deactivate the logic task.

But I'm not sure if this is a clean solution. Suggestions and ideas are welcome.


Reply to this email directly or view it on GitHub.

@ohinckel
Copy link
Author

Created new PR smarthomeNG/smarthome#108 in new project and will close this issue now. Thanks for your great application!

@ohinckel ohinckel closed this Aug 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants