mirror of
https://github.com/home-assistant/core.git
synced 2026-07-13 01:27:57 +01:00
Use Attribute enum in input_datetime (#175737)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user