You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation for this block is a bit misleading. It seems to read that if you omit to put an interval, the status check will be done at the time of the click to decide whether to do command_on or command_off.
But in fact the state is defined before that, by default or from a previous check and the command_state seems to be run after the toggle to validate the new state.
Context
I use many toggle blocks to control systemd services and I don't want to have 15 service checks running every x seconds, so I don't use intervals.
And I've always been a bit annoyed that if a service crashes a few seconds after launch I had to recheck manually because the toggle didn't take into account the change of state between 2 clicks.
To be sure I tested the block today with a simple grep/sed:
When the block is "on" and I manually write "off" in the test file, it should check again when I click before using command_on or command_on and stay on. But it's not the case and it switches to off.
Suggestions
When using "interval" I think that it's a good idea to use command_state only after a toggle, but with the "on click" behavior it should be checked before and after.
The text was updated successfully, but these errors were encountered:
Issue
The documentation for this block is a bit misleading. It seems to read that if you omit to put an interval, the status check will be done at the time of the click to decide whether to do command_on or command_off.
But in fact the state is defined before that, by default or from a previous check and the command_state seems to be run after the toggle to validate the new state.
Context
I use many toggle blocks to control systemd services and I don't want to have 15 service checks running every x seconds, so I don't use intervals.
And I've always been a bit annoyed that if a service crashes a few seconds after launch I had to recheck manually because the toggle didn't take into account the change of state between 2 clicks.
To be sure I tested the block today with a simple grep/sed:
When the block is "on" and I manually write "off" in the test file, it should check again when I click before using command_on or command_on and stay on. But it's not the case and it switches to off.
Suggestions
When using "interval" I think that it's a good idea to use command_state only after a toggle, but with the "on click" behavior it should be checked before and after.
The text was updated successfully, but these errors were encountered: