1
mirror of https://github.com/home-assistant/core synced 2024-09-28 03:04:04 +02:00

Add some more required/optional tags to condition schemas (#58424)

This commit is contained in:
Paulus Schoutsen 2021-10-26 08:25:15 -07:00 committed by GitHub
parent f1b082a369
commit 5deeeed672
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1029,13 +1029,13 @@ TIME_CONDITION_SCHEMA = vol.All(
{
**CONDITION_BASE_SCHEMA,
vol.Required(CONF_CONDITION): "time",
"before": vol.Any(
vol.Optional("before"): vol.Any(
time, vol.All(str, entity_domain(["input_datetime", "sensor"]))
),
"after": vol.Any(
vol.Optional("after"): vol.Any(
time, vol.All(str, entity_domain(["input_datetime", "sensor"]))
),
"weekday": weekdays,
vol.Optional("weekday"): weekdays,
}
),
has_at_least_one_key("before", "after", "weekday"),
@ -1054,7 +1054,7 @@ ZONE_CONDITION_SCHEMA = vol.Schema(
**CONDITION_BASE_SCHEMA,
vol.Required(CONF_CONDITION): "zone",
vol.Required(CONF_ENTITY_ID): entity_ids,
"zone": entity_ids,
vol.Required("zone"): entity_ids,
# To support use_trigger_value in automation
# Deprecated 2016/04/25
vol.Optional("event"): vol.Any("enter", "leave"),