Support adding and removing entities to devices (#191)

New entities can be added via + button under Integrations (like when
adding a new device) and entities can be removed from Options.
This commit is contained in:
Pierre Ståhl
2020-12-17 21:36:24 +01:00
committed by GitHub
parent 6869a0ac5d
commit 654c6cdc62
4 changed files with 108 additions and 46 deletions

View File

@@ -72,7 +72,7 @@ class TuyaDiscovery(asyncio.DatagramProtocol):
def device_found(self, device):
"""Discover a new device."""
if device.get("ip") not in self.devices:
self.devices[device.get("ip")] = device
self.devices[device.get("gwId")] = device
_LOGGER.debug("Discovered device: %s", device)
if self._callback: