Skip to content

Commit

Permalink
feat: add timer label to Timer sensor attributes (#2359)
Browse files Browse the repository at this point in the history
  • Loading branch information
Canis-L-Sapien authored Jul 26, 2024
1 parent 80b5451 commit db5abc4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions custom_components/alexa_media/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,18 @@ def icon(self):
)
return self._attr_icon if not self.paused else off_icon

@property
def timer(self):
"""Return the timer of the sensor."""
return self._next.get("timerLabel") if self._next else None

@property
def extra_state_attributes(self):
"""Return the scene state attributes."""
attr = super().extra_state_attributes
attr.update({"timer": self.timer})
return attr


class ReminderSensor(AlexaMediaNotificationSensor):
"""Representation of a Alexa Reminder sensor."""
Expand Down

0 comments on commit db5abc4

Please sign in to comment.