diff --git a/homeassistant/components/input_datetime/__init__.py b/homeassistant/components/input_datetime/__init__.py index 09bf3f855bd..9359d056982 100644 --- a/homeassistant/components/input_datetime/__init__.py +++ b/homeassistant/components/input_datetime/__init__.py @@ -5,8 +5,9 @@ import datetime import voluptuous as vol from homeassistant.const import ( - ATTR_DATE, ATTR_ENTITY_ID, ATTR_TIME, CONF_ICON, CONF_NAME) + ATTR_DATE, ATTR_TIME, CONF_ICON, CONF_NAME) import homeassistant.helpers.config_validation as cv +from homeassistant.helpers.config_validation import ENTITY_SERVICE_SCHEMA from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.restore_state import RestoreEntity from homeassistant.util import dt as dt_util @@ -27,8 +28,7 @@ ATTR_DATETIME = 'datetime' SERVICE_SET_DATETIME = 'set_datetime' -SERVICE_SET_DATETIME_SCHEMA = vol.Schema({ - vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, +SERVICE_SET_DATETIME_SCHEMA = ENTITY_SERVICE_SCHEMA.extend({ vol.Optional(ATTR_DATE): cv.date, vol.Optional(ATTR_TIME): cv.time, vol.Optional(ATTR_DATETIME): cv.datetime, diff --git a/tests/components/input_datetime/test_init.py b/tests/components/input_datetime/test_init.py index 94c521dbfe4..1b98c572a1f 100644 --- a/tests/components/input_datetime/test_init.py +++ b/tests/components/input_datetime/test_init.py @@ -9,8 +9,8 @@ import voluptuous as vol from homeassistant.core import CoreState, State, Context from homeassistant.setup import async_setup_component from homeassistant.components.input_datetime import ( - DOMAIN, ATTR_ENTITY_ID, ATTR_DATE, ATTR_DATETIME, ATTR_TIME, - SERVICE_SET_DATETIME) + DOMAIN, ATTR_DATE, ATTR_DATETIME, ATTR_TIME, SERVICE_SET_DATETIME) +from homeassistant.const import ATTR_ENTITY_ID from tests.common import mock_restore_cache