Skip to content

Commit

Permalink
Simplify the UOM check
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanJoubert committed Aug 11, 2023
1 parent 24babcb commit b141943
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions custom_components/solarman/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,8 @@ def update(self):
self.p_state = val[self._field_name]
else:
uom = getattr(self, 'uom', None)
if uom:
if (re.match("\S+", uom)):
self.p_state = None
if uom and (re.match("\S+", uom)):
self.p_state = None
_LOGGER.debug(f'No value recorded for {self._field_name}')


Expand Down

0 comments on commit b141943

Please sign in to comment.