add device registry

This commit is contained in:
Andrey
2021-01-15 09:10:42 +03:00
parent 254015be4c
commit c4f4510941
7 changed files with 61 additions and 36 deletions

View File

@@ -65,7 +65,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry, asyn
async def scan():
async for port, pty, m in hub.scan_ports():
if pty == "0":
sensor = MegaBinarySensor(mega_id=mid, port=port)
sensor = MegaBinarySensor(mega_id=mid, port=port, config_entry=config_entry)
devices.append(sensor)
async_add_devices(devices)