Fix multiple output devices. Also allow connection to multiple meshes?

This commit is contained in:
2022-10-19 20:13:13 +02:00
parent 87ed481f80
commit 8797b119f2
5 changed files with 24 additions and 27 deletions

View File

@@ -16,9 +16,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
dev = devices[d]
if dev.type == "switch":
coordinator = Coordinator(hass, dev)
async def updateCallback(data):
coordinator.async_set_updated_data(data)
dev.updateCallback = updateCallback
dev.updateCallback = coordinator.async_set_updated_data
switch = PlejdSwitch(coordinator, dev)
entities.append(switch)
async_add_entities(entities, False)
@@ -38,10 +36,6 @@ class PlejdSwitch(SwitchEntity, CoordinatorEntity):
def _data(self):
return self.coordinator.data or {}
@property
def available(self):
return self._data.get("state", None) is not None
@property
def device_info(self):
return {