Skip to content

Commit

Permalink
Issue 12: better error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jshufro committed Jul 29, 2020
1 parent 1547867 commit 4e898dd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions noaa_tides/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ def device_state_attributes(self):
if self.attr is None:
self.attr = {ATTR_ATTRIBUTION: DEFAULT_ATTRIBUTION}
if self.data is None:
self.update_tide_factor_from_attr()
return self.attr

now = datetime.now()
Expand Down Expand Up @@ -178,8 +177,8 @@ def update(self):
)
except ValueError as err:
_LOGGER.error(f"Check NOAA Tides and Currents: {err.args}")
self.data = None

except ConnectionError as err:
_LOGGER.error(f"Couldn't connect to NOAA Ties and Currents API: {err}")

class NOAATemperatureSensor(Entity):
"""Representation of a NOAA Temperature sensor."""
Expand Down

0 comments on commit 4e898dd

Please sign in to comment.