Fix problem with restoring POE control (#30597)

pull/30803/head
Robert Svensson 2020-01-08 22:33:51 +01:00 committed by Paulus Schoutsen
parent 0b3b589457
commit 5a8311e9d8
1 changed files with 7 additions and 4 deletions

View File

@ -42,12 +42,15 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
_, mac = entity.unique_id.split("-", 1)
if mac in controller.api.clients or mac not in controller.api.clients_all:
if mac in controller.api.clients:
switches_off.append(entity.unique_id)
continue
client = controller.api.clients_all[mac]
controller.api.clients.process_raw([client.raw])
switches_off.append(entity.unique_id)
if mac in controller.api.clients_all:
client = controller.api.clients_all[mac]
controller.api.clients.process_raw([client.raw])
switches_off.append(entity.unique_id)
continue
@callback
def update_controller():