1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

UniFi - use entity registry disabled_by to control available entities (#26141)

* Move ignoring logic to entity registry enabled default

* Handle config to option import better

* Properly enable and disable entity registry entries on changes from config entry options

* Fix balloobs comments

* Fix some tests

* Fix tests

* Simplify updating disable on entities

* Simplify device tracker update function

* Local entity disabled replaced on rebase

* Only alter entities with changed options

* Proper tracking of changed options

* Back to straightforward updating of disabled
This commit is contained in:
Robert Svensson
2019-08-31 22:04:04 +02:00
committed by GitHub
parent 922522b089
commit d9ef92f6d2
7 changed files with 172 additions and 105 deletions

View File

@@ -61,7 +61,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
"""Update the values of the controller."""
update_items(controller, async_add_entities, switches, switches_off)
async_dispatcher_connect(hass, controller.event_update, update_controller)
async_dispatcher_connect(hass, controller.signal_update, update_controller)
update_controller()
switches_off.clear()
@@ -220,7 +220,7 @@ class UniFiPOEClientSwitch(UniFiClient, SwitchDevice, RestoreEntity):
or self.client.sw_mac
and (
self.controller.available
or self.client.sw_mac in self.controller.api.devices
and self.client.sw_mac in self.controller.api.devices
)
)