Skip to content

Commit

Permalink
Merge pull request #21 from bj00rn/fix/error-code-sensor-value-when-n…
Browse files Browse the repository at this point in the history
…o-data

fix(sensor): error code sensor value should be None if not present in…
  • Loading branch information
bj00rn authored Nov 24, 2023
2 parents fd7bebe + dbbe3d4 commit be837b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/saleryd_hrv/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ def _translate_value(self, value):
except TypeError as exc:
_LOGGER.debug(exc)

if self.entity_description.key == "*EB":
return any(value)

if value is None:
return value

if self.entity_description.key == "*EB":
return any(value)

value = value[0] if isinstance(value, list) else value

if self.entity_description.key == "MG":
Expand Down

0 comments on commit be837b4

Please sign in to comment.