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:
@@ -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
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user