Skip to content

Commit

Permalink
Fix for null clampAmps
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-r committed Jan 1, 2024
1 parent 929f6f3 commit 4c334a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/ohme/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ async def async_get_ct_reading(self):
resp = await self._get_request(f"/v1/chargeDevices/{self._serial}/advancedSettings")

# If we ever get a reading above 0, assume CT connected
if resp['clampAmps'] > 0:
if resp['clampAmps'] and resp['clampAmps'] > 0:
self._ct_connected = True

return resp['clampAmps']
Expand Down

0 comments on commit 4c334a4

Please sign in to comment.