input_datetime: Move has_date, has_time to capability_attributes (#58138)

This commit is contained in:
Paulus Schoutsen 2021-10-20 23:22:34 -07:00 committed by GitHub
parent acb24788d0
commit 4eea618cc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -341,13 +341,19 @@ class InputDatetime(RestoreEntity):
return self._current_datetime.strftime(FMT_TIME)
@property
def capability_attributes(self) -> dict:
"""Return the capability attributes."""
return {
CONF_HAS_DATE: self.has_date,
CONF_HAS_TIME: self.has_time,
}
@property
def extra_state_attributes(self):
"""Return the state attributes."""
attrs = {
ATTR_EDITABLE: self.editable,
CONF_HAS_DATE: self.has_date,
CONF_HAS_TIME: self.has_time,
}
if self._current_datetime is None: