WebThingsIO / gpio-adapter

GPIO adapter add-on for WebThings Gateway
Mozilla Public License 2.0
5 stars 12 forks source link

Added PushButton support and activeLow support #28

Closed dhylands closed 5 years ago

dhylands commented 5 years ago

Fixes #26 Fixes #27

dhylands commented 5 years ago

I think the difference is really semantics. The pushed property and on property will always wind up being in sync, so it really boils down to what the user has connected to the pin.

What would be ideal is if the choice was pushed back down to the adapter so that it could advertise just the appropriate properties.

Either that or we add a configuration option to indicate whether a push button or binary sensor is connected and then the adapter will only present the configured option.

mrstegeman commented 5 years ago

Either that or we add a configuration option to indicate whether a push button or binary sensor is connected and then the adapter will only present the configured option.

This is what I'd prefer. The user already has to manually configure all of their pins, so it makes sense to require this as part of the pin setup.

dhylands commented 5 years ago

OK - PushButton versus BinarySensor is now a config option.

Aside: I noticed that if I change the direction from BinarySensor to PushButton then the properties get updated automagically, but the type of the input changes to a generic thing rather than PushButton. I have to remove the thing, disable the gpio adapter and re-enable it and re-add then it will show up properly. I think others have reported this problem with other adapters as well.