mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
Fix Genius Hub entity service schema (#50024)
This commit is contained in:
parent
9ce00018be
commit
d4565c0e27
@ -4,7 +4,6 @@ from datetime import timedelta
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.switch import DEVICE_CLASS_OUTLET, SwitchEntity
|
from homeassistant.components.switch import DEVICE_CLASS_OUTLET, SwitchEntity
|
||||||
from homeassistant.const import ATTR_ENTITY_ID
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import config_validation as cv, entity_platform
|
from homeassistant.helpers import config_validation as cv, entity_platform
|
||||||
from homeassistant.helpers.typing import ConfigType
|
from homeassistant.helpers.typing import ConfigType
|
||||||
@ -15,15 +14,12 @@ GH_ON_OFF_ZONE = "on / off"
|
|||||||
|
|
||||||
SVC_SET_SWITCH_OVERRIDE = "set_switch_override"
|
SVC_SET_SWITCH_OVERRIDE = "set_switch_override"
|
||||||
|
|
||||||
SET_SWITCH_OVERRIDE_SCHEMA = vol.Schema(
|
SET_SWITCH_OVERRIDE_SCHEMA = {
|
||||||
{
|
vol.Optional(ATTR_DURATION): vol.All(
|
||||||
vol.Required(ATTR_ENTITY_ID): cv.entity_id,
|
cv.time_period,
|
||||||
vol.Optional(ATTR_DURATION): vol.All(
|
vol.Range(min=timedelta(minutes=5), max=timedelta(days=1)),
|
||||||
cv.time_period,
|
),
|
||||||
vol.Range(min=timedelta(minutes=5), max=timedelta(days=1)),
|
}
|
||||||
),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_platform(
|
async def async_setup_platform(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user