* Add a new optional "data" key when defining time ranges for the schedule component that exposes the provided data in the state attributes of the schedule entity when that time range is active * Exclude all schedule entry custom data attributes from the recorder (with tests) * Fix setting schedule attributes to exclude from recorder, update test to verify the attributes exist but are not recorded * Fix test to ensure schedule data attributes are not recorded * Use vol.Any in place of vol.Or Co-authored-by: Erik Montnemery <erik@montnemery.com> * Remove schedule block custom data shorthand as requested in https://github.com/home-assistant/core/pull/116585#pullrequestreview-2280260436 * Update homeassistant/components/schedule/__init__.py --------- Co-authored-by: Erik Montnemery <erik@montnemery.com>
39 lines
827 B
Python
39 lines
827 B
Python
"""Constants for the schedule integration."""
|
|
|
|
import logging
|
|
from typing import Final
|
|
|
|
DOMAIN: Final = "schedule"
|
|
LOGGER = logging.getLogger(__package__)
|
|
|
|
CONF_DATA: Final = "data"
|
|
CONF_FRIDAY: Final = "friday"
|
|
CONF_FROM: Final = "from"
|
|
CONF_MONDAY: Final = "monday"
|
|
CONF_SATURDAY: Final = "saturday"
|
|
CONF_SUNDAY: Final = "sunday"
|
|
CONF_THURSDAY: Final = "thursday"
|
|
CONF_TO: Final = "to"
|
|
CONF_TUESDAY: Final = "tuesday"
|
|
CONF_WEDNESDAY: Final = "wednesday"
|
|
CONF_ALL_DAYS: Final = {
|
|
CONF_MONDAY,
|
|
CONF_TUESDAY,
|
|
CONF_WEDNESDAY,
|
|
CONF_THURSDAY,
|
|
CONF_FRIDAY,
|
|
CONF_SATURDAY,
|
|
CONF_SUNDAY,
|
|
}
|
|
|
|
ATTR_NEXT_EVENT: Final = "next_event"
|
|
|
|
WEEKDAY_TO_CONF: Final = {
|
|
0: CONF_MONDAY,
|
|
1: CONF_TUESDAY,
|
|
2: CONF_WEDNESDAY,
|
|
3: CONF_THURSDAY,
|
|
4: CONF_FRIDAY,
|
|
5: CONF_SATURDAY,
|
|
6: CONF_SUNDAY,
|
|
}
|