emerald-hws 0.0.19__py3-none-any.whl → 0.0.21__py3-none-any.whl

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/emeraldhws.py CHANGED
@@ -109,8 +109,16 @@ 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
+ property_data = post_response_json.get("info", {}).get("property")
113
+
112
114
  with self._state_lock:
113
- self.properties = post_response_json.get("info").get("property")
115
+ self.properties = property_data
116
+
117
+ # Check if we got valid data
118
+ if not isinstance(property_data, list) or len(property_data) == 0:
119
+ # Log the full response when properties are invalid to help diagnose the issue
120
+ self.logger.debug(f"emeraldhws: Poperties empty/invalid, full response: {post_response_json}")
121
+ raise Exception("No heat pumps found on account - API returned empty or invalid property list")
114
122
  else:
115
123
  raise Exception("Unable to fetch properties from Emerald API")
116
124
 
@@ -130,7 +138,10 @@ class EmeraldHWS():
130
138
  return list(self.properties) # Return a copy
131
139
  time.sleep(0.1) # Small delay before retry
132
140
 
133
- raise Exception("Timeout waiting for properties to be populated")
141
+ # Timeout - provide detailed error message
142
+ with self._state_lock:
143
+ final_value = self.properties
144
+ raise Exception(f"Timeout waiting for properties to be populated. Current value: {type(final_value).__name__} = {final_value}")
134
145
 
135
146
  def replaceCallback(self, update_callback):
136
147
  """ Replaces the current registered update callback (if any) with the supplied
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: emerald_hws
3
- Version: 0.0.19
3
+ Version: 0.0.21
4
4
  Summary: A package to manipulate and monitor Emerald Heat Pump Hot Water Systems
5
5
  Author-email: Ross Williamson <ross@inertia.net.nz>
6
6
  License-Expression: MIT
@@ -0,0 +1,7 @@
1
+ emerald_hws/__init__.py,sha256=uukjQ-kiPYKWvGT3jLL6kJA1DCNAxtw4HlLKqPSypXs,61
2
+ emerald_hws/emeraldhws.py,sha256=e9IILqA_OUunTRBDtdutO8KIcMnUv8JJ1c5pmoFX2po,28124
3
+ emerald_hws/__assets__/SFSRootCAG2.pem,sha256=hw9W0AnYrrlbcWsOewAgIl1ULEsoO57Ylu35dCjWcS4,1424
4
+ emerald_hws-0.0.21.dist-info/METADATA,sha256=ZIVIV_DK89_pebFmddygh7QvxN9LpaGKiWwYw0ndavk,2534
5
+ emerald_hws-0.0.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ emerald_hws-0.0.21.dist-info/top_level.txt,sha256=ZCiUmnBkDr2n4QVkTet1s_AKiGJjuz3heuCR5w5ZqLY,12
7
+ emerald_hws-0.0.21.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- emerald_hws/__init__.py,sha256=uukjQ-kiPYKWvGT3jLL6kJA1DCNAxtw4HlLKqPSypXs,61
2
- emerald_hws/emeraldhws.py,sha256=Zew-LUriunMceTCRm28ysQ6-wL-wkS8WEWKCn_x9dXQ,27452
3
- emerald_hws/__assets__/SFSRootCAG2.pem,sha256=hw9W0AnYrrlbcWsOewAgIl1ULEsoO57Ylu35dCjWcS4,1424
4
- emerald_hws-0.0.19.dist-info/METADATA,sha256=I5ed2dPU2OO9eO9UMZmSKgscxm_uyqp2g9i3VGcKgYQ,2534
5
- emerald_hws-0.0.19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
- emerald_hws-0.0.19.dist-info/top_level.txt,sha256=ZCiUmnBkDr2n4QVkTet1s_AKiGJjuz3heuCR5w5ZqLY,12
7
- emerald_hws-0.0.19.dist-info/RECORD,,