blueair-api 1.36.1__tar.gz → 1.36.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {blueair_api-1.36.1 → blueair_api-1.36.3}/PKG-INFO +1 -1
- {blueair_api-1.36.1 → blueair_api-1.36.3}/pyproject.toml +1 -1
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api/device_aws.py +1 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api/intermediate_representation_aws.py +2 -2
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api.egg-info/PKG-INFO +1 -1
- {blueair_api-1.36.1 → blueair_api-1.36.3}/tests/test_device_aws.py +14 -11
- {blueair_api-1.36.1 → blueair_api-1.36.3}/tests/test_intermediate_representation_aws.py +1 -6
- {blueair_api-1.36.1 → blueair_api-1.36.3}/LICENSE +0 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/README.md +0 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/setup.cfg +0 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api/__init__.py +0 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api/callbacks.py +0 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api/const.py +0 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api/device.py +0 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api/errors.py +0 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api/http_aws_blueair.py +0 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api/http_blueair.py +0 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api/model_enum.py +0 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api/stub.py +0 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api/util.py +0 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api/util_bootstrap.py +0 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api/util_http.py +0 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api.egg-info/SOURCES.txt +0 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api.egg-info/dependency_links.txt +0 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api.egg-info/requires.txt +0 -0
- {blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api.egg-info/top_level.txt +0 -0
@@ -101,6 +101,7 @@ class DeviceAws(CallbacksMixin):
|
|
101
101
|
self.tVOC = sensor_data_safe_get("tVOC")
|
102
102
|
self.temperature = sensor_data_safe_get("t")
|
103
103
|
self.humidity = sensor_data_safe_get("h")
|
104
|
+
self.fan_speed_0 = sensor_data_safe_get("fsp0")
|
104
105
|
|
105
106
|
def info_safe_get(path):
|
106
107
|
# directly reads for the schema. If the schema field is
|
{blueair_api-1.36.1 → blueair_api-1.36.3}/src/blueair_api/intermediate_representation_aws.py
RENAMED
@@ -117,7 +117,7 @@ class Control:
|
|
117
117
|
|
118
118
|
@dataclasses.dataclass
|
119
119
|
class SensorRecord:
|
120
|
-
values:
|
120
|
+
values: dict[str, int]
|
121
121
|
timestamp: float | None
|
122
122
|
|
123
123
|
|
@@ -137,7 +137,7 @@ class SensorHistory(list[SensorRecord]):
|
|
137
137
|
def to_latest(self) -> SensorRecord:
|
138
138
|
def key(e):
|
139
139
|
return e.timestamp
|
140
|
-
self.sort(key=key)
|
140
|
+
self.sort(key=key, reverse=True)
|
141
141
|
if len(self) > 0:
|
142
142
|
return self[0]
|
143
143
|
else:
|
@@ -97,11 +97,12 @@ class DeviceAwsTestBase(IsolatedAsyncioTestCase):
|
|
97
97
|
"states": [],
|
98
98
|
})
|
99
99
|
|
100
|
-
|
101
|
-
return [{
|
100
|
+
self.device_sensor_helper = {"mock_data": [{
|
102
101
|
"datapoints": [],
|
103
102
|
"sensors": []
|
104
|
-
}]
|
103
|
+
}]}
|
104
|
+
async def fake_sensors(device_name, device_uuid):
|
105
|
+
return self.device_sensor_helper["mock_data"]
|
105
106
|
|
106
107
|
self.api.device_sensors.side_effect = fake_sensors
|
107
108
|
self.api.device_info.side_effect = self.device_info_helper.device_info
|
@@ -563,6 +564,9 @@ class Protect7470iTest(DeviceAwsTestBase):
|
|
563
564
|
with open(resources.files().joinpath('device_info/protect_7470i.json')) as sample_file:
|
564
565
|
info = json.load(sample_file)
|
565
566
|
self.device_info_helper.info.update(info)
|
567
|
+
with open(resources.files().joinpath('device_info/protect_7470i_sensors.json')) as sample_file:
|
568
|
+
sensors = json.load(sample_file)
|
569
|
+
self.device_sensor_helper["mock_data"] = sensors
|
566
570
|
|
567
571
|
async def test_attributes(self):
|
568
572
|
|
@@ -572,13 +576,12 @@ class Protect7470iTest(DeviceAwsTestBase):
|
|
572
576
|
with assert_fully_checked(self.device) as device:
|
573
577
|
|
574
578
|
assert device.model == ModelEnum.PROTECT_7470I
|
575
|
-
|
576
|
-
assert device.
|
577
|
-
assert device.
|
578
|
-
assert device.
|
579
|
-
assert device.
|
580
|
-
assert device.
|
581
|
-
assert device.humidity is None
|
579
|
+
assert device.pm1 == 0
|
580
|
+
assert device.pm2_5 == 0
|
581
|
+
assert device.pm10 == 0
|
582
|
+
assert device.tVOC == 134
|
583
|
+
assert device.temperature == 23
|
584
|
+
assert device.humidity == 55
|
582
585
|
assert device.name == "air filter in room"
|
583
586
|
assert device.firmware == "2.1.1"
|
584
587
|
assert device.mcu_firmware == "1.0.12"
|
@@ -605,7 +608,7 @@ class Protect7470iTest(DeviceAwsTestBase):
|
|
605
608
|
assert device.cool_sub_mode is NotImplemented
|
606
609
|
assert device.cool_fan_speed is NotImplemented
|
607
610
|
assert device.ap_sub_mode is NotImplemented
|
608
|
-
assert device.fan_speed_0 is
|
611
|
+
assert device.fan_speed_0 is 91
|
609
612
|
assert device.temperature_unit is NotImplemented
|
610
613
|
|
611
614
|
|
@@ -70,15 +70,10 @@ class SensorHistoryTest(TestCase):
|
|
70
70
|
"fsp0": 91
|
71
71
|
}
|
72
72
|
|
73
|
-
assert sh.to_latest().timestamp ==
|
74
|
-
|
75
|
-
# assert latest['v'].timestamp == 1
|
76
|
-
# assert latest['v'].value == 1
|
77
|
-
# assert isinstance(latest['v'].value, float)
|
73
|
+
assert sh.to_latest().timestamp == 3
|
78
74
|
|
79
75
|
|
80
76
|
class SensorPackTest(TestCase):
|
81
|
-
|
82
77
|
def testSimple(self):
|
83
78
|
sp = ir.SensorPack( [
|
84
79
|
{'n': 'v', 't': 1, 'v': 1},
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|