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

[switch.js] Support force off and keep off #436

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tuaminx
Copy link

@tuaminx tuaminx commented Sep 18, 2018

Changes:

  • Add forceOffAfter in config to force the switch off after the configured duration (in second)
  • Add keepOffDuration in config to keep the swtich off until the configured duration's expiration (in second)
  • Add onlyKeepOffWhenForcedTurnOff in config (boolean). When set by true, keepOffDuration only applied if switch was forced off by forceOffAfter

Usage:
I want to limit my little child's TV time so I had a cron-job on raspberry to alert by voice when TV was opened for 30min (shell script with mpg123 tool). I set forceOffAfter to 40min to force the TV off if she didn't follow the alert.
Beside, onlyKeepOffWhenForcedTurnOff was set to true and keepOffDuration was set to 60min as a penalty: If she follow the alert, she can turn on the TV whenever she want. Otherwise, she need to wait for at least 60min.

- Add `forceOffAfter` in config to force the switch off after the
configured duration (in second)
- Add `keepOffDuration` in config to keep the swtich off until the
configured duration's expiration (in second)
- Add `onlyKeepOffWhenForcedTurnOff` in config. When set by `true`,
`keepOffDuration` only applied if switch is foreced off by
`forceOffAfter`
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.

1 participant