emerald-hws 0.0.21__tar.gz → 0.0.23__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.
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/PKG-INFO +1 -1
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/src/emerald_hws/emeraldhws.py +34 -5
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/src/emerald_hws.egg-info/PKG-INFO +1 -1
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/.github/dependabot.yml +0 -0
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/.github/workflows/lint.yml +0 -0
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/.github/workflows/publish.yml +0 -0
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/.github/workflows/smoke-test.yml +0 -0
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/.gitignore +0 -0
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/LICENSE +0 -0
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/README.md +0 -0
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/pyproject.toml +0 -0
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/requirements.txt +0 -0
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/setup.cfg +0 -0
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/src/emerald_hws/__assets__/SFSRootCAG2.pem +0 -0
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/src/emerald_hws/__init__.py +0 -0
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/src/emerald_hws.egg-info/SOURCES.txt +0 -0
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/src/emerald_hws.egg-info/dependency_links.txt +0 -0
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/src/emerald_hws.egg-info/requires.txt +0 -0
- {emerald_hws-0.0.21 → emerald_hws-0.0.23}/src/emerald_hws.egg-info/top_level.txt +0 -0
@@ -109,13 +109,24 @@ class EmeraldHWS():
|
|
109
109
|
|
110
110
|
if post_response_json.get("code") == 200:
|
111
111
|
self.logger.debug("emeraldhws: Successfully logged into Emerald API")
|
112
|
-
|
112
|
+
info = post_response_json.get("info", {})
|
113
|
+
|
114
|
+
# Retrieve both property and shared_property arrays
|
115
|
+
property_data = info.get("property", [])
|
116
|
+
shared_property_data = info.get("shared_property", [])
|
117
|
+
|
118
|
+
# Combine both arrays into a single list
|
119
|
+
combined_properties = []
|
120
|
+
if isinstance(property_data, list):
|
121
|
+
combined_properties.extend(property_data)
|
122
|
+
if isinstance(shared_property_data, list):
|
123
|
+
combined_properties.extend(shared_property_data)
|
113
124
|
|
114
125
|
with self._state_lock:
|
115
|
-
self.properties =
|
126
|
+
self.properties = combined_properties
|
116
127
|
|
117
128
|
# Check if we got valid data
|
118
|
-
if
|
129
|
+
if len(combined_properties) == 0:
|
119
130
|
# Log the full response when properties are invalid to help diagnose the issue
|
120
131
|
self.logger.debug(f"emeraldhws: Poperties empty/invalid, full response: {post_response_json}")
|
121
132
|
raise Exception("No heat pumps found on account - API returned empty or invalid property list")
|
@@ -157,8 +168,21 @@ class EmeraldHWS():
|
|
157
168
|
self.logger.info(f"emeraldhws: awsiot: Reconnecting MQTT connection (reason: {reason})")
|
158
169
|
|
159
170
|
if self.mqttClient is not None:
|
160
|
-
|
161
|
-
self.
|
171
|
+
# Clear connection event before stopping
|
172
|
+
self._connection_event.clear()
|
173
|
+
|
174
|
+
try:
|
175
|
+
# Stop the client and wait for it to fully stop
|
176
|
+
stop_future = self.mqttClient.stop()
|
177
|
+
if stop_future:
|
178
|
+
# Wait up to 10 seconds for clean shutdown
|
179
|
+
stop_future.result(timeout=10)
|
180
|
+
self.logger.debug("emeraldhws: awsiot: MQTT client stopped successfully")
|
181
|
+
except Exception as e:
|
182
|
+
self.logger.warning(f"emeraldhws: awsiot: Error stopping MQTT client: {e}")
|
183
|
+
finally:
|
184
|
+
# Always clear the client reference
|
185
|
+
self.mqttClient = None
|
162
186
|
|
163
187
|
self.connectMQTT()
|
164
188
|
self.subscribeAllHWS()
|
@@ -306,6 +330,8 @@ class EmeraldHWS():
|
|
306
330
|
""" Log message when stopped
|
307
331
|
"""
|
308
332
|
self.logger.debug("emeraldhws: awsiot: stopped")
|
333
|
+
# Clear connection event when stopped
|
334
|
+
self._connection_event.clear()
|
309
335
|
return
|
310
336
|
|
311
337
|
def on_lifecycle_disconnection(self, lifecycle_disconnect_data: mqtt5.LifecycleDisconnectData):
|
@@ -328,6 +354,9 @@ class EmeraldHWS():
|
|
328
354
|
self.logger.debug(f"emeraldhws: awsiot: disconnect data: {lifecycle_disconnect_data.__dict__}")
|
329
355
|
|
330
356
|
self.logger.info(f"emeraldhws: awsiot: disconnected - {reason}")
|
357
|
+
|
358
|
+
# Clear connection event when disconnected
|
359
|
+
self._connection_event.clear()
|
331
360
|
return
|
332
361
|
|
333
362
|
def on_lifecycle_attempting_connect(self, lifecycle_attempting_connect_data: mqtt5.LifecycleAttemptingConnectData):
|
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
|