-
-
Notifications
You must be signed in to change notification settings - Fork 421
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
Toggle functionality for "boolean" types #4381
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Martin Grześlowski <[email protected]>
How about a |
Is there a toggle command? |
Currently not - I am suggesting it might make sense to implement one. |
No way. I already saw long discussions about it. If you want you can do it #947 |
Umm. I have an issue with your word 'toggle' .. its dictionary definition is "to switch a feature on a computer on and off by pressing the same button or key" .. in other words the 'toggle' operation executes TWO operations e.g. ON=>OFF=>ON. So I suggest some other word like 'invert' or 'reverse' or 'flip' .. |
I think you misunderstand the Cambridge dictonary (or I did). Look at examples of usage:
Edit: And definition from Google (of course without link to source...) |
I believe |
At least in American English at least, "toggle" is the correct term for something that switches the current state of a switch regardless of the state it's already in. That's the common usage for that term. I cannot speak for other English dialects. I imagine if a way to implement a TOGGLE command in a way that doesn't require modifyinmg all the add-ons that implement Switch Channels it might be more acceptable than where the past discussions went. And most of the controversy in the ESH thread at least was around whether discussion about whether it was a good idea or not should be allowed or if the PR should just be merged without discussion. I personally am not convinced by the arguments against a TOGGLE command. It should be up to the admin of each individual OH instance to decide whether TOGGLE is a dangerous command or not and configure their OH instance accordingly.
You'd still need a test for NULL and UNDEF as that would obviously fail with an error. I'm not sure this approach buys us much. In fact
is preferable becuase if the state is NULL or UNDEF the switch will be commanded OFF instead of throwing an error. |
Hey,
Writing DSL functions I found out that it would be really nice to be able to toggle types to opposite, i.e. You got command
ON
from item x and you want to send commandOFF
(opposite command) to item y:vs
WDYT?