nfarina / homebridge-sonos

Sonos plugin for homebridge: https://github.com/nfarina/homebridge
153 stars 52 forks source link

Dynamic device grouping (Sonos mobile or Desktop app) and on-the-fly update of registered accessories with homebridge-sonos #12

Closed fwboettger closed 8 years ago

fwboettger commented 8 years ago

@nfarina - i'm now going to look into the plugin implementation enhancement to register to topology change events (nodes-sonos listener functionality) and to react to it accordingly. As far as i understand the general homebridge plugin and the specific sonos plugin implementation, one would need to de-register ("unbind"?) previously discovered devices as per the "SonosAccessory.prototype.search" function and to re-discover and correspondingly re-register ("bind"?) appropriate devices in case of certain topology changes. Question: how to best achieve this de-registering/unbinding of affected previously discovered devices?

nfarina commented 8 years ago

This is not currently possible with homebridge. Services/Accessories cannot be changed after the plugin first initializes.

fwboettger commented 8 years ago

@nfarina - thanks much (also for fixing my mistake with the missing reference to the underscore package, apologies for that). Is it possible to change an accessories' "this.device" member during runtime? If yes, this would probably the solution then, if not then i don't have an idea how to possibly handle such dynamic group management changes....

nfarina commented 8 years ago

You can certainly change what devices you're speaking with "behind the scenes" at any time - but when HomeKit discovers an Accessory, that accessory's details shouldn't change at runtime.

fwboettger commented 8 years ago

Thanks much for confirmation, this is perfect then and the way to go :-)

fwboettger commented 8 years ago

Thanks