Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.schedule Namespace Reference

Namespaces

 const
 

Classes

class  Schedule
 
class  ScheduleStorageCollection
 

Functions

bool async_setup (HomeAssistant hass, ConfigType config)
 
Any deserialize_to_time (Any value)
 
Any serialize_to_time (Any value)
 
list[dict[str, str]] valid_schedule (list[dict[str, str]] schedule)
 

Variables

 CONFIG_SCHEMA
 
 CUSTOM_DATA_SCHEMA = vol.Schema({str: vol.Any(bool, str, int, float)})
 
 day
 
 default
 
 ENTITY_SCHEMA
 
 STORAGE_SCHEMA
 
 STORAGE_TIME_RANGE_SCHEMA
 
int STORAGE_VERSION = 1
 
int STORAGE_VERSION_MINOR = 1
 
 VolDictType
 

Detailed Description

Support for schedules in Home Assistant.

Function Documentation

◆ async_setup()

bool homeassistant.components.schedule.async_setup ( HomeAssistant  hass,
ConfigType  config 
)
Set up a schedule.

Definition at line 159 of file __init__.py.

◆ deserialize_to_time()

Any homeassistant.components.schedule.deserialize_to_time ( Any  value)
Convert 24:00 and 24:00:00 to time.max.

Definition at line 84 of file __init__.py.

◆ serialize_to_time()

Any homeassistant.components.schedule.serialize_to_time ( Any  value)
Convert time.max to 24:00:00.

Definition at line 101 of file __init__.py.

◆ valid_schedule()

list[dict[str, str]] homeassistant.components.schedule.valid_schedule ( list[dict[str, str]]  schedule)
Validate the schedule of time ranges.

Ensure they have no overlap and the end time is greater than the start time.

Definition at line 54 of file __init__.py.

Variable Documentation

◆ CONFIG_SCHEMA

homeassistant.components.schedule.CONFIG_SCHEMA
Initial value:
1 = vol.Schema(
2  {DOMAIN: cv.schema_with_slug_keys(vol.All(BASE_SCHEMA | SCHEDULE_SCHEMA))},
3  extra=vol.ALLOW_EXTRA,
4 )

Definition at line 145 of file __init__.py.

◆ CUSTOM_DATA_SCHEMA

homeassistant.components.schedule.CUSTOM_DATA_SCHEMA = vol.Schema({str: vol.Any(bool, str, int, float)})

Definition at line 114 of file __init__.py.

◆ day

homeassistant.components.schedule.day

Definition at line 132 of file __init__.py.

◆ default

homeassistant.components.schedule.default

Definition at line 132 of file __init__.py.

◆ ENTITY_SCHEMA

homeassistant.components.schedule.ENTITY_SCHEMA
Initial value:
1 = vol.Schema(
2  {vol.Required(CONF_ID): cv.string} | BASE_SCHEMA | SCHEDULE_SCHEMA
3 )

Definition at line 154 of file __init__.py.

◆ STORAGE_SCHEMA

homeassistant.components.schedule.STORAGE_SCHEMA
Initial value:
1 = vol.Schema(
2  {vol.Required(CONF_ID): cv.string} | BASE_SCHEMA | STORAGE_SCHEDULE_SCHEMA
3 )

Definition at line 150 of file __init__.py.

◆ STORAGE_TIME_RANGE_SCHEMA

homeassistant.components.schedule.STORAGE_TIME_RANGE_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Required(CONF_FROM): vol.Coerce(str),
4  vol.Required(CONF_TO): serialize_to_time,
5  vol.Optional(CONF_DATA): CUSTOM_DATA_SCHEMA,
6  }
7 )

Definition at line 123 of file __init__.py.

◆ STORAGE_VERSION

int homeassistant.components.schedule.STORAGE_VERSION = 1

Definition at line 50 of file __init__.py.

◆ STORAGE_VERSION_MINOR

int homeassistant.components.schedule.STORAGE_VERSION_MINOR = 1

Definition at line 51 of file __init__.py.

◆ VolDictType

homeassistant.components.schedule.VolDictType

Definition at line 116 of file __init__.py.