diff --git a/homeassistant/components/smarttub/binary_sensor.py b/homeassistant/components/smarttub/binary_sensor.py index 331c0b7e3d7..7bb4e8cc9e0 100644 --- a/homeassistant/components/smarttub/binary_sensor.py +++ b/homeassistant/components/smarttub/binary_sensor.py @@ -29,9 +29,11 @@ ATTR_CREATED_AT = "created_at" ATTR_UPDATED_AT = "updated_at" # how many days to snooze the reminder for -ATTR_SNOOZE_DAYS = "days" +ATTR_REMINDER_DAYS = "days" SNOOZE_REMINDER_SCHEMA = { - vol.Required(ATTR_SNOOZE_DAYS): vol.All(vol.Coerce(int), vol.Range(min=10, max=120)) + vol.Required(ATTR_REMINDER_DAYS): vol.All( + vol.Coerce(int), vol.Range(min=10, max=120) + ) } @@ -117,6 +119,7 @@ class SmartTubReminder(SmartTubEntity, BinarySensorEntity): """Return the state attributes.""" return { ATTR_REMINDER_SNOOZED: self.reminder.snoozed, + ATTR_REMINDER_DAYS: self.reminder.remaining_days, } async def async_snooze(self, days): diff --git a/tests/components/smarttub/test_binary_sensor.py b/tests/components/smarttub/test_binary_sensor.py index 16b4f60d3e4..98d404ef600 100644 --- a/tests/components/smarttub/test_binary_sensor.py +++ b/tests/components/smarttub/test_binary_sensor.py @@ -30,6 +30,7 @@ async def test_reminders(spa, setup_entry, hass): assert state is not None assert state.state == STATE_OFF assert state.attributes["snoozed"] is False + assert state.attributes["days"] == 2 @pytest.fixture