Set default position value for cover action (#45670)
Co-authored-by: Bram Kragten <mail@bramkragten.nl> Co-authored-by: Franck Nijhof <git@frenck.dev>pull/45723/head
parent
ace5b58337
commit
84f506efb7
|
@ -49,7 +49,9 @@ POSITION_ACTION_SCHEMA = cv.DEVICE_ACTION_BASE_SCHEMA.extend(
|
|||
{
|
||||
vol.Required(CONF_TYPE): vol.In(POSITION_ACTION_TYPES),
|
||||
vol.Required(CONF_ENTITY_ID): cv.entity_domain(DOMAIN),
|
||||
vol.Required("position"): vol.All(vol.Coerce(int), vol.Range(min=0, max=100)),
|
||||
vol.Optional("position", default=0): vol.All(
|
||||
vol.Coerce(int), vol.Range(min=0, max=100)
|
||||
),
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -266,7 +266,7 @@ def entity_id(value: Any) -> str:
|
|||
if valid_entity_id(str_value):
|
||||
return str_value
|
||||
|
||||
raise vol.Invalid(f"Entity ID {value} is an invalid entity id")
|
||||
raise vol.Invalid(f"Entity ID {value} is an invalid entity ID")
|
||||
|
||||
|
||||
def entity_ids(value: Union[str, List]) -> List[str]:
|
||||
|
|
Loading…
Reference in New Issue