Add area support to input datetime service schemas (#25430)

* Add area support to input datetime service schemas

* Fixed tests
pull/25450/head
Aaron Bach 2019-07-23 13:39:07 -06:00 committed by GitHub
parent 3af77eb594
commit c92f287c73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -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,

View File

@ -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