Closed oudoulj closed 9 months ago
homeassistant.toggle
is not suitable since it's a relative operation and not an absolute one.
For the README file:
Note: This service is not suitable for the following scenarios:
- ...
- For a relative state change: for example,
fan.increase_speed
is relative whilelight.turn_on
is absolute. The reason is that a relative service call might change the state and only then a failure occurs. Calling it again might have an unintentional result.- ...
I'm adding homeassistant.toggle
as another explicit example in the documentation quoted above.
https://github.com/amitfin/retry/commit/5f2f3264d7fb39002f55d5f0b4bc65203f2c3f2a (the README file update)
Please note that it's not needed to double the amount of automation rules in order to use absolute operations. It's possible to use trigger ID with if-then or choose which can then have absolute operations based on the trigger ID.
Please note that it's not needed to double the amount of automation rules in order to use absolute operations. It's possible to use trigger ID with if-then or choose which can then have absolute operations based on the trigger ID.
Interesting approach/suggestion! Thank you for the answer and the update of the README file :+1:
Checklist
Is your feature request related to a problem? Please describe.
I am wondering if
service: homeassistant.toggle
is a suitable service to use Retry with? I use that service to turn on/off lights in one automation instead of having 2 of them (one foroff
and one foron
)Describe the solution you'd like
I was thinking of
but I'd like to be sure to, say, turn off the light and not turn it on in case the light was on and the toggle was called BUT failed and then was "retried" but this second time it would try to turn the light on (instead of off). Hope I make sense ^^
Describe alternatives you've considered
I don't have any.
Additional context
No additional context.