athombv / homey-web-api-issues

This issue tracker is for Homey Developers using the Web API.
4 stars 1 forks source link

homey.device.on('capability.update') is broken and never fires #51

Closed hive closed 3 weeks ago

hive commented 8 months ago

Currently the capability update/create/delete events documented here : https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerDevices.html#.event:%22capability.update%22 will never fire.

And thus its not possible to listen to capability changes and provide appropriate updates.

I would expect that this event emitter (specifically the update) provide similar information to the makeCapabilityInstance at the same time.

jeroenwienk commented 8 months ago

Currently the capability update/create/delete events documented here : https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerDevices.html#.event:%22capability.update%22 will never fire.

And thus its not possible to listen to capability changes and provide appropriate updates.

I would expect that this event emitter (specifically the update) provide similar information to the makeCapabilityInstance at the same time.

This event is not the same as the one from a capability instance.

hive commented 8 months ago

Is it for when a capability is added or removed from a device? When would you expect the update to fire?

WeeJeWel commented 3 weeks ago

capability.update probably won't fire, because (custom) Capabilities are only created and deleted.

jeroenwienk commented 3 weeks ago

Is it for when a capability is added or removed from a device? When would you expect the update to fire?

A capability is an item in the backend of Homey. These events are when capabilities are created for apps,system.

To listen to capability changes of a device a capability instance can be created. Or to listen to all changes on a device the device.on('capability', (value) => {}) can be used. Note that this wont update the values inside the device.capabilitiesObjautomatically so it is advised to use the capability instance method.