-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[ism8] Allow linking switch-r to Contact items #17742
Conversation
Signed-off-by: Holger Friedrich <[email protected]>
Personally i like the idea to let the user choose the item they like to use. On the other hand a I think it would be best to create an issue at the main UI repo to ask for real read-only switch support. As currently the user is able to toggle the switch even if it is marked read-only. Do you have an example where a contact is a better fit then a switch? |
For read-only switch, with sitemap UIs, you can simply use a Text element. |
...openhab.binding.ism8/src/main/java/org/openhab/binding/ism8/internal/util/Ism8DomainMap.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Holger Friedrich <[email protected]>
Yes, if the elements of the sitemap are listed explicitly. If you just include Groups to your sitemap and let OH generate the list of items OH will stick to the type of the single element.... |
Additional testing done on live system to check if this breaks the code for normal switch items. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM
* [ism8] Allow linking switch-... to Contact items Signed-off-by: Holger Friedrich <[email protected]>
* [ism8] Allow linking switch-... to Contact items Signed-off-by: Holger Friedrich <[email protected]> Signed-off-by: Ciprian Pascu <[email protected]>
switch-r elements are typically mapped to Switch items.
With this PR, you can also map them to Contact items.
This is better suited for the read-only elements.
Additionally, I added the warning statement about DPT 1.009 to the README. (It is the same as for KNX, DPT1.009 should have been inverted. Implementing it correctly will break existing installations.)
Without this PR, Contact items are not compatible and will not be updated.
I am not sure about the approach (using DecimalType 0 and 1 instead of enum identifiers from OnOffType).
Further testing is recommended. I did a short developer test, Contact and Switch items are now being filled correctly when data arrives.