-
Notifications
You must be signed in to change notification settings - Fork 1
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
button
capability not triggering listener for device.makeCapabilityInstance()
?
#19
Comments
Why would you need the state of a stateless button? |
I don't need the state, but I would like to be able to catch button presses (for instance, a doorbell button being pressed) and pass them to HomeKit. AFAIK using a capability instance listener is the only (programmatic) way of doing that. |
You could listen to This would of course require that you check if it is an actual button capability. |
I'll see if I can make it work with this 👍🏻 FWIW, is this a regular |
Yes or Listeners are also removed if the device is destroyed(deleted). |
I can't get the |
Ah yes it seems |
I got it working, but it looks like the |
🤦 it only happens for getable === true capabilities. |
This is decided in the firmware btw. |
Any idea if this a (relatively) recent change? HomeyKit has had a |
It's been like this for at least 4 years. But there are button capabilities that are stateful. I think you can override it with capabilityOptions aswell and then it would emit the 'capability' event. |
It looks like the relevant HomeyKit code is even older than that, so I guess it was never noticed (or complained about). I'll close this issue since I cannot control the capabilities of devices of other apps and it's not a big deal anyway 😊 Thanks for your help! |
The HomeKitty app relies on
device.makeCapabilityInstance()
to watch for capability changes.This works fine for the most part, but it looks like changes to
button
capabilities don't trigger a call to the listener.I initially tested this with virtual devices (both from the Virtual Devices and the Device Capabilities apps), but to rule out an issue with those apps I wrote a test app, and the issue also occurs with that.
The registered capability listener for
button
in the device driver gets triggered as expected, so the capability itself is "wired in" correctly AFAICS.It's also not limited to HomeKitty: the current version of HomeyKit, which uses a completely different codebase, also doesn't receive any change "events" for that capability.
The text was updated successfully, but these errors were encountered: