Skip to content

Commit 8944db0

Browse files
authored
feat: More i35 support (#19)
* Better model name information. - Add SKU to prepare for better device model inference in ha_blueair. - and fix type_name propagation. * match version number with i35 branch of ha_blueair * Revert version edit.
1 parent 01fe20f commit 8944db0

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ keywords = [
3535

3636
[project.urls]
3737
"Homepage" = "https://github.com/dahlb/blueair_api"
38-
"Bug Tracker" = "https://github.com/dahlb/blueair_api/issues"
38+
"Bug Tracker" = "https://github.com/dahlb/blueair_api/issues"

src/blueair_api/device_aws.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class DeviceAws(CallbacksMixin):
1212
name: str = None
1313
name_api: str = None
1414
mac: str = None
15+
type_name: str = None
16+
17+
sku: str = None
1518
firmware: str = None
1619
mcu_firmware: str = None
1720
serial_number: str = None
@@ -36,7 +39,7 @@ class DeviceAws(CallbacksMixin):
3639
# i35
3740
wick_usage: int = None # percentage
3841
wick_dry_mode: bool = None
39-
wshortage: bool = None
42+
water_shortage: bool = None
4043
auto_regulated_humidity: int = None
4144

4245
def __init__(
@@ -55,6 +58,7 @@ def __init__(
5558
_LOGGER.debug(f"creating blueair device aws: {self.uuid}")
5659

5760
async def refresh(self):
61+
_LOGGER.debug(f"refreshing blueair device aws: {self.uuid}")
5862
info = await self.api.device_info(self.name_api, self.uuid)
5963
sensor_data = convert_api_array_to_dict(info["sensordata"])
6064
self.pm1 = safely_get_json_value(sensor_data, "pm1", int)
@@ -68,6 +72,7 @@ async def refresh(self):
6872
self.firmware = safely_get_json_value(info, "configuration.di.cfv")
6973
self.mcu_firmware = safely_get_json_value(info, "configuration.di.mfv")
7074
self.serial_number = safely_get_json_value(info, "configuration.di.ds")
75+
self.sku = safely_get_json_value(info, "configuration.di.sku")
7176

7277
states = convert_api_array_to_dict(info["states"])
7378
self.running = safely_get_json_value(states, "standby") is False
@@ -85,6 +90,7 @@ async def refresh(self):
8590
self.water_shortage = safely_get_json_value(states, "wshortage", bool)
8691

8792
self.publish_updates()
93+
_LOGGER.debug(f"refreshed blueair device aws: {self}")
8894

8995
async def set_brightness(self, value: int):
9096
self.brightness = value
@@ -131,6 +137,7 @@ def __repr__(self):
131137
"uuid": self.uuid,
132138
"name": self.name,
133139
"type_name": self.type_name,
140+
"sku": self.sku,
134141
"name_api": self.name_api,
135142
"mac": self.mac,
136143
"firmware": self.firmware,

src/blueair_api/util_bootstrap.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def create_device(device):
3232
uuid=device["uuid"],
3333
name=device["name"],
3434
mac=device["mac"],
35-
type_name=device["type"],
3635
)
3736

3837
devices = map(create_device, api_devices)
@@ -62,7 +61,10 @@ def create_device(device):
6261
uuid=device["uuid"],
6362
name_api=device["name"],
6463
mac=device["mac"],
64+
type_name=device["type"],
6565
)
6666

67-
devices = map(create_device, api_devices)
68-
return (api, list(devices))
67+
68+
devices = list(map(create_device, api_devices))
69+
70+
return (api, devices)

0 commit comments

Comments
 (0)