Replies: 1 comment 1 reply
-
Hi, and glad you found the project useful! :-) The cli tool actually supports toggle command, but it wasn't ever added to the library as implementing it outside the library is straightforward. The library design (i.e., you are expected to call update() to get the current device state) makes it rather cumbersome to implement it in a nice manner, so I'm not really keen on adding such into the library code, sorry.. Basically, any actions on the device will not update the internal state, so calling toggle() twice would cause rather unexpected behaviour (calling off or on twice, if no update is called in-between) from the library user's perspective. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Great library, just stumbled upon it today!
Looked around here:
Issue:
Didn't see a way to toggle between on and off.
I see a turn_on and turn_off but what if someone wanted to just toggle between off and on.
Use case:
We can turn things on and off by doing this:
or
But what if I just wanted to toggle? I would have to first check it's current state and then flip it.
What if there was a toggle function?
For example:
or
I could write a PR for this
Beta Was this translation helpful? Give feedback.
All reactions