Skip to content

Commit

Permalink
Merge pull request #13 from jshufro/Issue-12
Browse files Browse the repository at this point in the history
Issue 12: better error handling
  • Loading branch information
jshufro authored Jul 29, 2020
2 parents c160a05 + 4e898dd commit bdcbb6c
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 bdcbb6c

Please sign in to comment.