Skip to content
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

[globalcache] Update the Item type for Contact Closures to "Switch" #5721

Merged
merged 2 commits into from
Jun 14, 2019

Conversation

knikhilwiz
Copy link

@knikhilwiz knikhilwiz commented Jun 13, 2019

The current item type prevents globalcache contact closures from being modified by this module, since it is marked as an item type of "Contact" that can only accept "REFRESH" commands. So, while it can show changes that are done external to this module, all the functionality in the module that makes changes to the contact relays can never be triggered.

The documentation at https://www.openhab.org/addons/bindings/globalcache/ has examples that showcase both Switch and Contact item types. This change will make the Switch use cases actually work.

Today, this is shown in the log:
2019-06-12 22:39:05.386 [DEBUG] [.thing.internal.CommunicationManager] - Received event 'ON' (OnOffType) could not be converted to any type accepted by item 'HomeTheaterCurtainsOpen' (Switch) 2019-06-12 22:39:05.408 [DEBUG] [.thing.internal.CommunicationManager] - Received not accepted type 'OnOffType' for channel 'globalcache:itachCC:000C1E034EF7:cc-m1#c2'

Signed-off-by: Nick Hill knikhilwiz@gmail.com

The "Contact" item type cannot actually accept commands, so move it to a Switch. The documentation (https://www.openhab.org/addons/bindings/globalcache/) refers to defining these as both Contact and Switch types, but a Contact type is not very useful if you want to change the state of a relay.
@mhilbush
Copy link
Contributor

mhilbush commented Jun 13, 2019

I haven't tested this in a very long time. It worked at one time, but obviously doesn't anymore. Can you also update the README to make sure there are no references to Contact.

@knikhilwiz
Copy link
Author

I have updated README.md to reflect this as well.

@mhilbush
Copy link
Contributor

Thanks. This LGTM.

But, I see you missed the Signed-off-by on the commits. Hopefully, this meets the small patch exception and can be merged.

@knikhilwiz
Copy link
Author

Thanks Mark. Sorry, I have never committed to OpenHab before and am still learning the ropes.

I have added a "Signed-off-by" note in the commit description and also installed whatever github "application" that I was pointed to in the docs. What is the next step to get this PR approved?

I am using a custom jar file for my own purposes for now, so I am not blocking on this. I suspect other users may want this to work. Is there a way to backport this into 2.4 or can the bindings manifest point to a version that includes this change (2.5)?

@mhilbush
Copy link
Contributor

One of the maintainer will let us know if this meets the small patch exception, and therefore can be merged without the commit sign-offs. They'll also review the change and do the merge after whcih it will be available in the distribution. As for it being compatible with 2.4, there have been A LOT of changes between 2.4 and now, so I'm not so sure about compatibility.

Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine - thanks!

@kaikreuzer kaikreuzer merged commit 894028b into openhab:master Jun 14, 2019
Pshatsillo pushed a commit to Pshatsillo/openhab-addons that referenced this pull request Jun 19, 2019
…penhab#5721)

* Update the Item type for Contact Closures to Switch

The "Contact" item type cannot actually accept commands, so move it to a Switch. The documentation (https://www.openhab.org/addons/bindings/globalcache/) refers to defining these as both Contact and Switch types, but a Contact type is not very useful if you want to change the state of a relay.

Signed-off-by: Pshatsillo <pshatsillo@gmail.com>
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/global-cache-binding-gc100-12-and-contact-closure/76946/2

@knikhilwiz knikhilwiz deleted the patch-1 branch June 29, 2019 06:23
@wborn wborn added this to the 2.5 milestone Jul 30, 2019
ne0h pushed a commit to ne0h/openhab-addons that referenced this pull request Sep 15, 2019
…penhab#5721)

* Update the Item type for Contact Closures to Switch

The "Contact" item type cannot actually accept commands, so move it to a Switch. The documentation (https://www.openhab.org/addons/bindings/globalcache/) refers to defining these as both Contact and Switch types, but a Contact type is not very useful if you want to change the state of a relay.

Signed-off-by: Maximilian Hess <mail@ne0h.de>
tmrobert8 pushed a commit to tmrobert8/openhab-addons that referenced this pull request Jan 21, 2020
…penhab#5721)

* Update the Item type for Contact Closures to Switch

The "Contact" item type cannot actually accept commands, so move it to a Switch. The documentation (https://www.openhab.org/addons/bindings/globalcache/) refers to defining these as both Contact and Switch types, but a Contact type is not very useful if you want to change the state of a relay.

Signed-off-by: Tim Roberts <timmarkroberts@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants