emerald-hws 0.0.19__py3-none-any.whl → 0.0.20__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,15 @@ 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
+ self.logger.debug(f"emeraldhws: API returned property data: {property_data}")
114
+
112
115
  with self._state_lock:
113
- self.properties = post_response_json.get("info").get("property")
116
+ self.properties = property_data
117
+
118
+ # Check if we got valid data
119
+ if not isinstance(property_data, list) or len(property_data) == 0:
120
+ raise Exception("No heat pumps found on account - API returned empty or invalid property list")
114
121
  else:
115
122
  raise Exception("Unable to fetch properties from Emerald API")
116
123
 
@@ -130,7 +137,10 @@ class EmeraldHWS():
130
137
  return list(self.properties) # Return a copy
131
138
  time.sleep(0.1) # Small delay before retry
132
139
 
133
- raise Exception("Timeout waiting for properties to be populated")
140
+ # Timeout - provide detailed error message
141
+ with self._state_lock:
142
+ final_value = self.properties
143
+ raise Exception(f"Timeout waiting for properties to be populated. Current value: {type(final_value).__name__} = {final_value}")
134
144
 
135
145
  def replaceCallback(self, update_callback):
136
146
  """ 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.20
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=fVyZ_9uQp9RfHTaAI0ZlHIj37hIn2lHDNeXO0vysV4I,28008
3
+ emerald_hws/__assets__/SFSRootCAG2.pem,sha256=hw9W0AnYrrlbcWsOewAgIl1ULEsoO57Ylu35dCjWcS4,1424
4
+ emerald_hws-0.0.20.dist-info/METADATA,sha256=UE32BxNZQMJmdZ62Q-CXOOr0u76QMVoMoUQfpDWtvOE,2534
5
+ emerald_hws-0.0.20.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ emerald_hws-0.0.20.dist-info/top_level.txt,sha256=ZCiUmnBkDr2n4QVkTet1s_AKiGJjuz3heuCR5w5ZqLY,12
7
+ emerald_hws-0.0.20.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,,