pyhive-integration 1.0.8.dev5__tar.gz → 1.0.8.dev7__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.
- {pyhive_integration-1.0.8.dev5/pyhive_integration.egg-info → pyhive_integration-1.0.8.dev7}/PKG-INFO +1 -1
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7/pyhive_integration.egg-info}/PKG-INFO +1 -1
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/setup.py +1 -1
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/alarm.py +1 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/api/hive_api.py +1 -1
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/api/hive_async_api.py +2 -2
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/camera.py +1 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/heating.py +29 -9
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/hotwater.py +1 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/light.py +1 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/plug.py +1 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/sensor.py +1 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/session.py +1 -1
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/LICENSE +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/MANIFEST.in +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/README.md +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/pyhive_integration.egg-info/SOURCES.txt +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/pyhive_integration.egg-info/dependency_links.txt +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/pyhive_integration.egg-info/requires.txt +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/pyhive_integration.egg-info/top_level.txt +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/pyproject.toml +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/requirements.txt +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/requirements_test.txt +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/setup.cfg +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/__init__.py +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/action.py +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/api/__init__.py +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/api/hive_auth.py +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/api/hive_auth_async.py +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/device_attributes.py +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/helper/__init__.py +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/helper/const.py +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/helper/debugger.py +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/helper/hive_exceptions.py +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/helper/hive_helper.py +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/helper/hivedataclasses.py +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/helper/map.py +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/hive.py +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/hub.py +0 -0
- {pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/tests/test_hub.py +0 -0
|
@@ -17,7 +17,7 @@ def requirements_from_file(filename="requirements.txt"):
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
setup(
|
|
20
|
-
version="1.0.8.
|
|
20
|
+
version="1.0.8.dev7",
|
|
21
21
|
packages=["apyhiveapi", "apyhiveapi.api", "apyhiveapi.helper"],
|
|
22
22
|
package_dir={"apyhiveapi": "src"},
|
|
23
23
|
package_data={"data": ["*.json"]},
|
|
@@ -43,7 +43,7 @@ class HiveApiAsync:
|
|
|
43
43
|
"long_lived": "https://api.prod.bgchprod.info/omnia/accessTokens",
|
|
44
44
|
"weather": "https://weather.prod.bgchprod.info/weather",
|
|
45
45
|
}
|
|
46
|
-
self.timeout =
|
|
46
|
+
self.timeout = 5
|
|
47
47
|
self.json_return = {
|
|
48
48
|
"original": "No response to Hive API request",
|
|
49
49
|
"parsed": "No response to Hive API request",
|
|
@@ -84,7 +84,7 @@ class HiveApiAsync:
|
|
|
84
84
|
auth_token[-4:] if len(auth_token) >= 4 else auth_token,
|
|
85
85
|
)
|
|
86
86
|
|
|
87
|
-
timeout = ClientTimeout(total=
|
|
87
|
+
timeout = ClientTimeout(total=self.timeout)
|
|
88
88
|
req_start = time.monotonic()
|
|
89
89
|
async with self.websession.request(
|
|
90
90
|
method, url, headers=headers, data=data, timeout=timeout
|
|
@@ -54,7 +54,6 @@ class HiveHeating:
|
|
|
54
54
|
"""
|
|
55
55
|
from datetime import datetime
|
|
56
56
|
|
|
57
|
-
f_state = None
|
|
58
57
|
state = None
|
|
59
58
|
final = None
|
|
60
59
|
|
|
@@ -62,6 +61,16 @@ class HiveHeating:
|
|
|
62
61
|
data = self.session.data.products[device["hiveID"]]
|
|
63
62
|
state = data["props"]["temperature"]
|
|
64
63
|
|
|
64
|
+
try:
|
|
65
|
+
state = float(state)
|
|
66
|
+
except (ValueError, TypeError):
|
|
67
|
+
_LOGGER.debug(
|
|
68
|
+
"Non-numeric temperature value '%s' for %s.",
|
|
69
|
+
state,
|
|
70
|
+
device.get("haName", device.get("hiveID")),
|
|
71
|
+
)
|
|
72
|
+
return None
|
|
73
|
+
|
|
65
74
|
if device["hiveID"] in self.session.data.minMax:
|
|
66
75
|
if self.session.data.minMax[device["hiveID"]]["TodayDate"] == str(
|
|
67
76
|
datetime.date(datetime.now())
|
|
@@ -94,8 +103,7 @@ class HiveHeating:
|
|
|
94
103
|
}
|
|
95
104
|
self.session.data.minMax[device["hiveID"]] = data
|
|
96
105
|
|
|
97
|
-
|
|
98
|
-
final = f_state
|
|
106
|
+
final = round(state, 1)
|
|
99
107
|
except KeyError as e:
|
|
100
108
|
_LOGGER.error(e)
|
|
101
109
|
|
|
@@ -159,12 +167,13 @@ class HiveHeating:
|
|
|
159
167
|
try:
|
|
160
168
|
current_temp = await self.getCurrentTemperature(device)
|
|
161
169
|
target_temp = await self.getTargetTemperature(device)
|
|
162
|
-
if current_temp
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
170
|
+
if current_temp is not None and target_temp is not None:
|
|
171
|
+
if current_temp < target_temp:
|
|
172
|
+
state = "ON"
|
|
173
|
+
else:
|
|
174
|
+
state = "OFF"
|
|
175
|
+
final = HIVETOHA[self.heatingType].get(state, state)
|
|
176
|
+
except (KeyError, TypeError) as e:
|
|
168
177
|
_LOGGER.error(e)
|
|
169
178
|
|
|
170
179
|
return final
|
|
@@ -503,6 +512,17 @@ class Climate(HiveHeating):
|
|
|
503
512
|
device["haName"],
|
|
504
513
|
)
|
|
505
514
|
return cached
|
|
515
|
+
device.setdefault(
|
|
516
|
+
"status",
|
|
517
|
+
{
|
|
518
|
+
"current_temperature": None,
|
|
519
|
+
"target_temperature": None,
|
|
520
|
+
"action": None,
|
|
521
|
+
"mode": None,
|
|
522
|
+
"boost": None,
|
|
523
|
+
"state": None,
|
|
524
|
+
},
|
|
525
|
+
)
|
|
506
526
|
return device
|
|
507
527
|
|
|
508
528
|
async def getScheduleNowNextLater(self, device: dict):
|
|
@@ -540,7 +540,7 @@ class HiveSession:
|
|
|
540
540
|
except HiveAuthError as retry_err:
|
|
541
541
|
raise HiveReauthRequired from retry_err
|
|
542
542
|
api_call_duration = time.monotonic() - api_call_start
|
|
543
|
-
if api_call_duration >
|
|
543
|
+
if api_call_duration > 3:
|
|
544
544
|
_LOGGER.warning(
|
|
545
545
|
"Hive API response took %.1fs — marking poll as slow.",
|
|
546
546
|
api_call_duration,
|
|
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
|
|
File without changes
|
{pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/helper/hive_exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyhive_integration-1.0.8.dev5 → pyhive_integration-1.0.8.dev7}/src/helper/hivedataclasses.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|