Skip to content

Commit

Permalink
Fix the following: In a Connection Timeout, Station sensors will not …
Browse files Browse the repository at this point in the history
…be created because measure_unit attribute doesn't exits. Fix issue: is #7
  • Loading branch information
Danieldiazi committed Sep 23, 2023
1 parent 89f28ec commit c7d62df
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions custom_components/meteogalicia/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,9 @@ def __init__(self, name, ids, idMeasure,session, hass):
self.nameSuffix = ""
else:
self.nameSuffix = "_"+idMeasure

#Set default value for measure_unit, because when a Timeout error appears sensor doesn't will create if "measure_unit" doesn't exists
self.measure_unit = None


async def async_update(self) -> None:
Expand Down Expand Up @@ -783,6 +786,9 @@ def __init__(self, name, ids, idMeasure,session, hass):
self.nameSuffix = ""
else:
self.nameSuffix = "_"+idMeasure

#Set default value for measure_unit, because when a Timeout error appears sensor doesn't will create if "measure_unit" doesn't exists
self.measure_unit = None


async def async_update(self) -> None:
Expand Down

0 comments on commit c7d62df

Please sign in to comment.