Add area support to image processing service schemas (#25428)

pull/25450/head
Aaron Bach 2019-07-23 14:08:23 -06:00 committed by GitHub
parent a5c2a80db3
commit 2354108e6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -10,6 +10,7 @@ from homeassistant.const import (
from homeassistant.core import callback
from homeassistant.exceptions import HomeAssistantError
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.config_validation import ENTITY_SERVICE_SCHEMA
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.util.async_ import run_callback_threadsafe
@ -55,10 +56,6 @@ PLATFORM_SCHEMA = cv.PLATFORM_SCHEMA.extend({
})
PLATFORM_SCHEMA_BASE = cv.PLATFORM_SCHEMA_BASE.extend(PLATFORM_SCHEMA.schema)
SERVICE_SCAN_SCHEMA = vol.Schema({
vol.Optional(ATTR_ENTITY_ID): cv.comp_entity_ids,
})
async def async_setup(hass, config):
"""Set up the image processing."""
@ -81,7 +78,7 @@ async def async_setup(hass, config):
hass.services.async_register(
DOMAIN, SERVICE_SCAN, async_scan_service,
schema=SERVICE_SCAN_SCHEMA)
schema=ENTITY_SERVICE_SCHEMA)
return True