blueair-api 1.19.0__tar.gz → 1.20.1__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.19.0 → blueair_api-1.20.1}/PKG-INFO +1 -1
- {blueair_api-1.19.0 → blueair_api-1.20.1}/pyproject.toml +1 -1
- {blueair_api-1.19.0 → blueair_api-1.20.1}/src/blueair_api/device.py +1 -0
- {blueair_api-1.19.0 → blueair_api-1.20.1}/src/blueair_api/http_blueair.py +24 -0
- {blueair_api-1.19.0 → blueair_api-1.20.1}/src/blueair_api/model_enum.py +0 -2
- {blueair_api-1.19.0 → blueair_api-1.20.1}/src/blueair_api/util_bootstrap.py +5 -4
- {blueair_api-1.19.0 → blueair_api-1.20.1}/src/blueair_api.egg-info/PKG-INFO +1 -1
- {blueair_api-1.19.0 → blueair_api-1.20.1}/LICENSE +0 -0
- {blueair_api-1.19.0 → blueair_api-1.20.1}/README.md +0 -0
- {blueair_api-1.19.0 → blueair_api-1.20.1}/setup.cfg +0 -0
- {blueair_api-1.19.0 → blueair_api-1.20.1}/src/blueair_api/__init__.py +0 -0
- {blueair_api-1.19.0 → blueair_api-1.20.1}/src/blueair_api/callbacks.py +0 -0
- {blueair_api-1.19.0 → blueair_api-1.20.1}/src/blueair_api/const.py +0 -0
- {blueair_api-1.19.0 → blueair_api-1.20.1}/src/blueair_api/device_aws.py +0 -0
- {blueair_api-1.19.0 → blueair_api-1.20.1}/src/blueair_api/errors.py +0 -0
- {blueair_api-1.19.0 → blueair_api-1.20.1}/src/blueair_api/http_aws_blueair.py +0 -0
- {blueair_api-1.19.0 → blueair_api-1.20.1}/src/blueair_api/stub.py +0 -0
- {blueair_api-1.19.0 → blueair_api-1.20.1}/src/blueair_api/util.py +0 -0
- {blueair_api-1.19.0 → blueair_api-1.20.1}/src/blueair_api/util_http.py +0 -0
- {blueair_api-1.19.0 → blueair_api-1.20.1}/src/blueair_api.egg-info/SOURCES.txt +0 -0
- {blueair_api-1.19.0 → blueair_api-1.20.1}/src/blueair_api.egg-info/dependency_links.txt +0 -0
- {blueair_api-1.19.0 → blueair_api-1.20.1}/src/blueair_api.egg-info/requires.txt +0 -0
- {blueair_api-1.19.0 → blueair_api-1.20.1}/src/blueair_api.egg-info/top_level.txt +0 -0
@@ -54,6 +54,7 @@ class Device(CallbacksMixin):
|
|
54
54
|
async def refresh(self):
|
55
55
|
_LOGGER.debug("Requesting current attributes...")
|
56
56
|
attributes = await self.api.get_attributes(self.uuid)
|
57
|
+
_data_points = await self.api.get_current_data_point(self.uuid)
|
57
58
|
_LOGGER.debug(f"result: {attributes}")
|
58
59
|
if "brightness" in attributes:
|
59
60
|
self.brightness = int(attributes["brightness"])
|
@@ -177,6 +177,30 @@ class HttpBlueair:
|
|
177
177
|
)
|
178
178
|
return await response.json()
|
179
179
|
|
180
|
+
# Note: refreshes every 5 minutes, timestamps are in seconds
|
181
|
+
async def get_current_data_point(self, device_uuid: str) -> dict[str, any]:
|
182
|
+
"""
|
183
|
+
Fetch device information for the provided device ID.
|
184
|
+
|
185
|
+
The return value is a dictionary containing key-value pairs for the
|
186
|
+
available device information.
|
187
|
+
|
188
|
+
Note: the data for this API call is only updated once every 5 minutes.
|
189
|
+
Calling it more often will return the same respone from the server and
|
190
|
+
should be avoided to limit server load.
|
191
|
+
"""
|
192
|
+
url = f"https://{await self.get_home_host()}/v2/device/{device_uuid}/datapoint/0/last/0/"
|
193
|
+
headers = {
|
194
|
+
"X-API-KEY-TOKEN": API_KEY,
|
195
|
+
"X-AUTH-TOKEN": await self.get_auth_token(),
|
196
|
+
}
|
197
|
+
response: ClientResponse = (
|
198
|
+
await self._get_request_with_logging_and_errors_raised(
|
199
|
+
url=url, headers=headers
|
200
|
+
)
|
201
|
+
)
|
202
|
+
return await response.json()
|
203
|
+
|
180
204
|
async def set_fan_speed(self, device_uuid, new_speed: str):
|
181
205
|
"""
|
182
206
|
Set the fan speed per @spikeyGG comment at https://community.home-assistant.io/t/blueair-purifier-addon/154456/14
|
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
|