diff --git a/homeassistant/components/smarttub/binary_sensor.py b/homeassistant/components/smarttub/binary_sensor.py index 04a6bb9b72a..bbeece36655 100644 --- a/homeassistant/components/smarttub/binary_sensor.py +++ b/homeassistant/components/smarttub/binary_sensor.py @@ -1,5 +1,4 @@ """Platform for binary sensor integration.""" -from datetime import datetime, timedelta import logging from smarttub import SpaReminder @@ -17,8 +16,6 @@ _LOGGER = logging.getLogger(__name__) # whether the reminder has been snoozed (bool) ATTR_REMINDER_SNOOZED = "snoozed" -# the date at which the reminder will be activated -ATTR_REMINDER_DATE = "date" async def async_setup_entry(hass, entry, async_add_entities): @@ -83,12 +80,10 @@ class SmartTubReminder(SmartTubEntity, BinarySensorEntity): return self.reminder.remaining_days == 0 @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" - when = datetime.now() + timedelta(days=self.reminder.remaining_days) return { ATTR_REMINDER_SNOOZED: self.reminder.snoozed, - ATTR_REMINDER_DATE: when.date().isoformat(), } @property diff --git a/tests/components/smarttub/test_binary_sensor.py b/tests/components/smarttub/test_binary_sensor.py index 8229372e904..5db97310c56 100644 --- a/tests/components/smarttub/test_binary_sensor.py +++ b/tests/components/smarttub/test_binary_sensor.py @@ -1,6 +1,4 @@ """Test the SmartTub binary sensor platform.""" -from datetime import date, timedelta - from homeassistant.components.binary_sensor import ( DEVICE_CLASS_CONNECTIVITY, STATE_OFF, @@ -25,7 +23,4 @@ async def test_reminders(spa, setup_entry, hass): state = hass.states.get(entity_id) assert state is not None assert state.state == STATE_OFF - assert date.fromisoformat(state.attributes["date"]) <= date.today() + timedelta( - days=2 - ) assert state.attributes["snoozed"] is False