Fix Harmony entity service schema (#50025)

This commit is contained in:
Franck Nijhof 2021-05-03 18:41:16 +02:00 committed by GitHub
parent 2818df7aa9
commit 9ce00018be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,7 +15,6 @@ from homeassistant.components.remote import (
SUPPORT_ACTIVITY, SUPPORT_ACTIVITY,
) )
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import entity_platform from homeassistant.helpers import entity_platform
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
@ -44,14 +43,9 @@ PARALLEL_UPDATES = 0
ATTR_CHANNEL = "channel" ATTR_CHANNEL = "channel"
HARMONY_SYNC_SCHEMA = vol.Schema({vol.Optional(ATTR_ENTITY_ID): cv.entity_ids}) HARMONY_CHANGE_CHANNEL_SCHEMA = {
vol.Required(ATTR_CHANNEL): cv.positive_int,
HARMONY_CHANGE_CHANNEL_SCHEMA = vol.Schema( }
{
vol.Required(ATTR_ENTITY_ID): cv.entity_ids,
vol.Required(ATTR_CHANNEL): cv.positive_int,
}
)
async def async_setup_entry( async def async_setup_entry(
@ -74,7 +68,7 @@ async def async_setup_entry(
platform.async_register_entity_service( platform.async_register_entity_service(
SERVICE_SYNC, SERVICE_SYNC,
HARMONY_SYNC_SCHEMA, {},
"sync", "sync",
) )
platform.async_register_entity_service( platform.async_register_entity_service(