mirror of
https://github.com/Andre0512/pyhOn.git
synced 2024-11-28 08:20:51 +01:00
Disable zones for devices with just 1 zone, fixes #11
This commit is contained in:
parent
8372c75e30
commit
6c44aa895d
@ -61,8 +61,9 @@ class Hon:
|
|||||||
async def setup(self) -> None:
|
async def setup(self) -> None:
|
||||||
appliance: Dict
|
appliance: Dict
|
||||||
for appliance in (await self.api.load_appliances())["payload"]["appliances"]:
|
for appliance in (await self.api.load_appliances())["payload"]["appliances"]:
|
||||||
for zone in range(int(appliance.get("zone", "0"))):
|
if (zones := int(appliance.get("zone", "0"))) > 1:
|
||||||
await self._create_appliance(appliance.copy(), zone=zone + 1)
|
for zone in range(zones):
|
||||||
|
await self._create_appliance(appliance.copy(), zone=zone + 1)
|
||||||
await self._create_appliance(appliance)
|
await self._create_appliance(appliance)
|
||||||
|
|
||||||
async def close(self) -> None:
|
async def close(self) -> None:
|
||||||
|
Loading…
Reference in New Issue
Block a user