mirror of
https://github.com/Andre0512/pyhOn.git
synced 2025-05-31 14:58:24 -04:00
Fix error for zone devices
This commit is contained in:
parent
f54b7b2dbf
commit
a957d7ac0f
4 changed files with 8 additions and 3 deletions
|
@ -72,6 +72,10 @@ class HonAppliance:
|
|||
|
||||
@property
|
||||
def mac_address(self) -> str:
|
||||
return self.info.get("macAddress", "")
|
||||
|
||||
@property
|
||||
def unique_id(self) -> str:
|
||||
return self._check_name_zone("macAddress", frontend=False)
|
||||
|
||||
@property
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import asyncio
|
||||
import copy
|
||||
from typing import List, Optional, Dict, Any
|
||||
from typing_extensions import Self
|
||||
|
||||
|
@ -53,9 +54,10 @@ class Hon:
|
|||
self._appliances.append(appliance)
|
||||
|
||||
async def setup(self):
|
||||
appliance: Dict
|
||||
for appliance in (await self._api.load_appliances())["payload"]["appliances"]:
|
||||
for zone in range(int(appliance.get("zone", "0"))):
|
||||
await self._create_appliance(appliance, zone=zone + 1)
|
||||
await self._create_appliance(appliance.copy(), zone=zone + 1)
|
||||
await self._create_appliance(appliance)
|
||||
|
||||
async def close(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue