Skip to content

Commit

Permalink
fix: set prior_value based on prior_value status
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed May 24, 2020
1 parent 9e5aaef commit cf500da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/alexa_media/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ def _process_raw_notifications(self):
)
self._all = list(map(self._update_recurring_alarm, self._all))
self._all = sorted(self._all, key=lambda x: x[1][self._sensor_property])
self._prior_value = self._next if self._active else None
self._active = (
list(filter(lambda x: x[1]["status"] == "ON", self._all))
if self._all
else []
)
self._prior_value = self._next if self._active else None
self._next = self._active[0][1] if self._active else None

def _fix_alarm_date_time(self, value):
Expand Down

0 comments on commit cf500da

Please sign in to comment.