Skip to content

Commit

Permalink
Type-set int on pool_chemistry data
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattat01 committed Jan 6, 2025
1 parent 7da0049 commit 7ca8a4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/insnrg_chlorinator/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def state(self):
if pool_chemistry is None:
# If pool_chemistry is None (chlorinator off), return nothing so the state is not updated
return self._last_state.state if self._last_state is not None else "unknown"
if pool_chemistry.get(self._data_key) > 14:
if int(pool_chemistry.get(self._data_key)) > 14:
return self._last_state.state # if the value is crazy out of range, don't update the state
# Update the state based on the pool_chemistry data
self._state = pool_chemistry.get(self._data_key)
Expand Down Expand Up @@ -234,7 +234,7 @@ def state(self):
if pool_chemistry is None:
# If pool_chemistry is None (chlorinator off), return nothing so the state is not updated
return self._last_state.state if self._last_state is not None else "unknown"
if pool_chemistry.get(self._data_key) > 2000:
if int(pool_chemistry.get(self._data_key)) > 2000:
return self._last_state.state # if the value is crazy out of range, don't update the state
# Update the state based on the pool_chemistry data
self._state = pool_chemistry.get(self._data_key)
Expand Down

0 comments on commit 7ca8a4c

Please sign in to comment.