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

Lock relay status on boot #1705

Merged
merged 11 commits into from
Aug 12, 2019
Merged

Lock relay status on boot #1705

merged 11 commits into from
Aug 12, 2019

Conversation

mcspr
Copy link
Collaborator

@mcspr mcspr commented Apr 26, 2019

resolves #1697

  • relay_t::lock flag to control which target status we want. after relay changes to that status, we can no longer change it
  • boot mode setting to lock relay in either OFF or ON state

cc @goatchurchprime @xoseperez
this might interfere with planned motor changes from #1510 ?

@mcspr
Copy link
Collaborator Author

mcspr commented May 11, 2019

cc @lancelon
this will lock the relay instead of disabling the button. meaning, you can still receive button events if you want that
edit: PR adds the underlying api. meaning, we can also add something else (MQTT, HTTP API calls) to set lock. it is not only for boot modes

and plugging #1680 again, where you can modify hardware preset and just remove button gpio in config. also, see #1505 (instead of #1322 proposal).

@xoseperez
Copy link
Owner

I would add some visual notification to the web UI when the switch linked to the button is locked. Like disabling the toggle in the UI...

@mcspr
Copy link
Collaborator Author

mcspr commented May 24, 2019

"input[disabled]" does just that.
However, if lock becomes togglable, message should go with relayStatus instead. Maybe even nested within new relayState: {status: [...], lock:[...]}, since processData can encounter lock before any UI is initialized (can't depend on proper key ordering)

@mcspr mcspr merged commit d431121 into xoseperez:dev Aug 12, 2019
@mcspr mcspr deleted the relay/lock branch August 12, 2019 21:33
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.

Disable the switch option
2 participants