Skip to content

Commit 9096c45

Browse files
committed
feat: add setter for germ shield, BREAKING CHANGE remove running property and setter, chore: fix return typing error
1 parent 403f394 commit 9096c45

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

src/blueair_api/device_aws.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,6 @@ async def set_standby(self, value: bool):
138138
await self.api.set_device_info(self.uuid, "standby", "vb", value)
139139
self.publish_updates()
140140

141-
# FIXME: avoid state translation at the API level and depreate running.
142-
# replace with standby which is standard across aws devices.
143-
@property
144-
def running(self) -> AttributeType[bool]:
145-
if self.standby is None or self.standby is NotImplemented:
146-
return self.standby
147-
return not self.standby
148-
149-
async def set_running(self, running: bool):
150-
await self.set_standby(not running)
151-
152141
async def set_fan_auto_mode(self, fan_auto_mode: bool):
153142
self.fan_auto_mode = fan_auto_mode
154143
await self.api.set_device_info(self.uuid, "automode", "vb", fan_auto_mode)
@@ -174,6 +163,11 @@ async def set_wick_dry_mode(self, value: bool):
174163
await self.api.set_device_info(self.uuid, "wickdrys", "vb", value)
175164
self.publish_updates()
176165

166+
async def set_germ_shield(self, value: bool):
167+
self.germ_shield = value
168+
await self.api.set_device_info(self.uuid, "germshield", "vb", value)
169+
self.publish_updates()
170+
177171
@property
178172
def model(self) -> ModelEnum:
179173
if self.sku == "111633":

src/blueair_api/stub.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
# run with "python3 src/blueair_api/stub.py"
22
import logging
33
import asyncio
4-
from threading import Event
54

65
from getpass import getpass
76
from pathlib import Path
87
import sys
98

10-
# import blueair_api
11-
129
path_root = Path(__file__).parents[2]
1310
sys.path.append(str(path_root))
14-
from src.blueair_api import get_devices, get_aws_devices
11+
from src.blueair_api import get_devices, get_aws_devices, DeviceAws
1512

1613

1714
logger = logging.getLogger("src.blueair_api")
@@ -30,7 +27,6 @@ async def testing():
3027
api, devices = await get_aws_devices(username=username, password=password)
3128
for device in devices:
3229
await device.refresh()
33-
await device.set_child_lock(True)
3430
logger.debug(device)
3531
finally:
3632
if api:

src/blueair_api/util_bootstrap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async def get_aws_devices(
4545
password: str,
4646
region: str = "us",
4747
client_session: ClientSession | None = None,
48-
) -> tuple[HttpAwsBlueair, list[Device]]:
48+
) -> tuple[HttpAwsBlueair, list[DeviceAws]]:
4949
api = HttpAwsBlueair(
5050
username=username,
5151
password=password,

0 commit comments

Comments
 (0)