NorDroN / homebridge-wideq

MIT License
12 stars 5 forks source link

Dynamic accessory removal/creation #11

Closed ncovercash closed 4 years ago

ncovercash commented 4 years ago

This solves the "TODO remove accessories only if needed".

Rather than removing and re-creating all accessories on each run, this will only remove accessories when they're removed from the configuration, and only add when it was not yet already registered.

The best way to find the accessory ID was, as best I could tell, was through ParseUtil.getByModel(device.device.type).getAccessoryUUID(d.id); – there's likely a better way? This works, but let me know if there are potential improvements!