Skip to content

Commit

Permalink
Merge pull request #542 from custom-components/dev
Browse files Browse the repository at this point in the history
fix: fix localization of timers
  • Loading branch information
alandtse authored Jan 24, 2020
2 parents dd03b88 + 0b7cbc2 commit 5c4a9fc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion custom_components/alexa_media/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ def _fix_alarm_date_time(self, value):
value[1][self._sensor_property] = datetime.datetime.fromtimestamp(
value[1]["alarmTime"] / 1000, tz=LOCAL_TIMEZONE
)
_LOGGER.warning(
"There is an old format alarm on %s set for %s. "
" This alarm should be removed in the Alexa app and recreated. ",
self._client.name,
dt.as_local(value[1][self._sensor_property]),
)
else:
_LOGGER.warning(
"%s is returning erroneous data. "
Expand Down Expand Up @@ -390,7 +396,7 @@ def state(self) -> datetime.datetime:
return (
dt.as_local(
super()._round_time(
dt.utc_from_timestamp(
datetime.datetime.fromtimestamp(
self._timestamp.timestamp()
+ self._next[self._sensor_property] / 1000
)
Expand Down

0 comments on commit 5c4a9fc

Please sign in to comment.