mirror of
https://github.com/Andre0512/hon.git
synced 2025-05-13 06:34:22 -04:00
Use unique_id instead of mac address for #22
This commit is contained in:
parent
83c5e3479e
commit
d91b3edb40
8 changed files with 23 additions and 23 deletions
|
@ -41,11 +41,11 @@ async def async_setup_entry(hass, entry: ConfigEntry, async_add_entities) -> Non
|
|||
coordinators = hass.data[DOMAIN]["coordinators"]
|
||||
appliances = []
|
||||
for device in hon.appliances:
|
||||
if device.mac_address in coordinators:
|
||||
coordinator = hass.data[DOMAIN]["coordinators"][device.mac_address]
|
||||
if device.unique_id in coordinators:
|
||||
coordinator = hass.data[DOMAIN]["coordinators"][device.unique_id]
|
||||
else:
|
||||
coordinator = HonCoordinator(hass, device)
|
||||
hass.data[DOMAIN]["coordinators"][device.mac_address] = coordinator
|
||||
hass.data[DOMAIN]["coordinators"][device.unique_id] = coordinator
|
||||
await coordinator.async_config_entry_first_refresh()
|
||||
|
||||
if descriptions := BUTTONS.get(device.appliance_type):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue