From a8859a8383104cd9bc2bdcf9bb5097fdba149aeb Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 6 Jul 2026 12:03:49 +0200 Subject: [PATCH] Use Attribute enum in input_datetime (#175737) --- homeassistant/components/input_datetime/reproduce_state.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/input_datetime/reproduce_state.py b/homeassistant/components/input_datetime/reproduce_state.py index ea087f7d8369..f01ab5ed3cc4 100644 --- a/homeassistant/components/input_datetime/reproduce_state.py +++ b/homeassistant/components/input_datetime/reproduce_state.py @@ -9,7 +9,8 @@ from homeassistant.const import ATTR_ENTITY_ID from homeassistant.core import Context, HomeAssistant, State from homeassistant.util import dt as dt_util -from . import ATTR_DATE, ATTR_DATETIME, ATTR_TIME, CONF_HAS_DATE, CONF_HAS_TIME, DOMAIN +from . import ATTR_DATE, ATTR_DATETIME, ATTR_TIME, DOMAIN +from .const import InputDatetimeEntityCapabilityAttribute _LOGGER = logging.getLogger(__name__) @@ -44,8 +45,8 @@ async def _async_reproduce_state( _LOGGER.warning("Unable to find entity %s", state.entity_id) return - has_time = cur_state.attributes.get(CONF_HAS_TIME) - has_date = cur_state.attributes.get(CONF_HAS_DATE) + has_time = cur_state.attributes.get(InputDatetimeEntityCapabilityAttribute.HAS_TIME) + has_date = cur_state.attributes.get(InputDatetimeEntityCapabilityAttribute.HAS_DATE) if not ( (is_valid_datetime(state.state) and has_date and has_time)