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

Support "optimistic" switches #280

Closed
climategadgets opened this issue Sep 8, 2023 · 0 comments
Closed

Support "optimistic" switches #280

climategadgets opened this issue Sep 8, 2023 · 0 comments

Comments

@climategadgets
Copy link
Member

climategadgets commented Sep 8, 2023

Existing Behavior

Hardware drivers verify results of setState() with getState(). Benefits: guaranteed behavior. Disadvantages: complicated control logic, chances to get stuck.

Problems with Existing Behavior

One particularly vile problem is with ESPHome switch MQTT component which reports the hardware state if it changes but doesn't report it if it stays the same, resulting in an apparent deadlock.

Behavior Adjustment

It is possible to treat hardware as 100% reliable and assume that it always accepts and executes commands, as long as reliability is enforced by other means.

Mandatory precautions

  • Optimistic behavior for performance sake must never be a default option
  • Whenever optimistic behavior is used, a clearly visible log warning must be issued.

Related Issues

#47, #271, #290

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant