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

Namespaces

 api
 
 application_credentials
 
 calendar
 
 config_flow
 
 const
 
 coordinator
 
 diagnostics
 
 store
 

Functions

bool async_entry_has_scopes (ConfigEntry entry)
 
None async_reload_entry (HomeAssistant hass, ConfigEntry entry)
 
None async_remove_entry (HomeAssistant hass, ConfigEntry entry)
 
None async_setup_add_event_service (HomeAssistant hass, GoogleCalendarService calendar_service)
 
bool async_setup_entry (HomeAssistant hass, ConfigEntry entry)
 
bool async_unload_entry (HomeAssistant hass, ConfigEntry entry)
 
dict[str, Any] get_calendar_info (HomeAssistant hass, Mapping[str, Any] calendar)
 
dict[str, Any] load_config (str path)
 
None update_config (str path, dict[str, Any] calendar)
 

Variables

 _EVENT_IN_TYPES
 
 _LOGGER = logging.getLogger(__name__)
 
 _SINGLE_CALSEARCH_CONFIG
 
 ADD_EVENT_SERVICE_SCHEMA
 
string CONF_CAL_ID = "cal_id"
 
string CONF_IGNORE_AVAILABILITY = "ignore_availability"
 
string CONF_MAX_RESULTS = "max_results"
 
string CONF_SEARCH = "search"
 
string CONF_TRACK = "track"
 
string CONF_TRACK_NEW = "track_new_calendar"
 
 CONFIG_SCHEMA = vol.Schema(cv.removed(DOMAIN), extra=vol.ALLOW_EXTRA)
 
string DEFAULT_CONF_OFFSET = "!!"
 
 DEVICE_SCHEMA
 
string ENTITY_ID_FORMAT = DOMAIN + ".{}"
 
string EVENT_CALENDAR_ID = "calendar_id"
 
list PLATFORMS = [Platform.CALENDAR]
 
string SERVICE_ADD_EVENT = "add_event"
 
string YAML_DEVICES = f"{DOMAIN}_calendars.yaml"
 

Detailed Description

Support for Google - Calendar Event Devices.

Function Documentation

◆ async_entry_has_scopes()

bool homeassistant.components.google.async_entry_has_scopes ( ConfigEntry  entry)
Verify that the config entry desired scope is present in the oauth token.

Definition at line 211 of file __init__.py.

◆ async_reload_entry()

None homeassistant.components.google.async_reload_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Reload config entry if the access options change.

Definition at line 225 of file __init__.py.

◆ async_remove_entry()

None homeassistant.components.google.async_remove_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Handle removal of a local storage.

Definition at line 231 of file __init__.py.

◆ async_setup_add_event_service()

None homeassistant.components.google.async_setup_add_event_service ( HomeAssistant  hass,
GoogleCalendarService  calendar_service 
)
Add the service to add events.

Definition at line 237 of file __init__.py.

◆ async_setup_entry()

bool homeassistant.components.google.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Set up Google from a config entry.

Definition at line 143 of file __init__.py.

◆ async_unload_entry()

bool homeassistant.components.google.async_unload_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Unload a config entry.

Definition at line 218 of file __init__.py.

◆ get_calendar_info()

dict[str, Any] homeassistant.components.google.get_calendar_info ( HomeAssistant  hass,
Mapping[str, Any]   calendar 
)
Convert data from Google into DEVICE_SCHEMA.

Definition at line 310 of file __init__.py.

◆ load_config()

dict[str, Any] homeassistant.components.google.load_config ( str  path)
Load the google_calendar_devices.yaml.

Definition at line 330 of file __init__.py.

◆ update_config()

None homeassistant.components.google.update_config ( str  path,
dict[str, Any]  calendar 
)
Write the google_calendar_devices.yaml.

Definition at line 346 of file __init__.py.

Variable Documentation

◆ _EVENT_IN_TYPES

homeassistant.components.google._EVENT_IN_TYPES
private
Initial value:
1 = vol.Schema(
2  {
3  vol.Exclusive(EVENT_IN_DAYS, EVENT_TYPES_CONF): cv.positive_int,
4  vol.Exclusive(EVENT_IN_WEEKS, EVENT_TYPES_CONF): cv.positive_int,
5  }
6 )

Definition at line 107 of file __init__.py.

◆ _LOGGER

homeassistant.components.google._LOGGER = logging.getLogger(__name__)
private

Definition at line 56 of file __init__.py.

◆ _SINGLE_CALSEARCH_CONFIG

homeassistant.components.google._SINGLE_CALSEARCH_CONFIG
private
Initial value:
1 = vol.All(
2  cv.deprecated(CONF_MAX_RESULTS),
3  vol.Schema(
4  {
5  vol.Required(CONF_NAME): cv.string,
6  vol.Required(CONF_DEVICE_ID): cv.string,
7  vol.Optional(CONF_IGNORE_AVAILABILITY, default=True): cv.boolean,
8  vol.Optional(CONF_OFFSET): cv.string,
9  vol.Optional(CONF_SEARCH): cv.string,
10  vol.Optional(CONF_TRACK): cv.boolean,
11  vol.Optional(CONF_MAX_RESULTS): cv.positive_int, # Now unused
12  }
13  ),
14 )

Definition at line 82 of file __init__.py.

◆ ADD_EVENT_SERVICE_SCHEMA

homeassistant.components.google.ADD_EVENT_SERVICE_SCHEMA
Initial value:
1 = vol.All(
2  cv.has_at_least_one_key(EVENT_START_DATE, EVENT_START_DATETIME, EVENT_IN),
3  cv.has_at_most_one_key(EVENT_START_DATE, EVENT_START_DATETIME, EVENT_IN),
4  {
5  vol.Required(EVENT_CALENDAR_ID): cv.string,
6  vol.Required(EVENT_SUMMARY): cv.string,
7  vol.Optional(EVENT_DESCRIPTION, default=""): cv.string,
8  vol.Optional(EVENT_LOCATION, default=""): cv.string,
9  vol.Inclusive(
10  EVENT_START_DATE, "dates", "Start and end dates must both be specified"
11  ): cv.date,
12  vol.Inclusive(
13  EVENT_END_DATE, "dates", "Start and end dates must both be specified"
14  ): cv.date,
15  vol.Inclusive(
16  EVENT_START_DATETIME,
17  "datetimes",
18  "Start and end datetimes must both be specified",
19  ): cv.datetime,
20  vol.Inclusive(
21  EVENT_END_DATETIME,
22  "datetimes",
23  "Start and end datetimes must both be specified",
24  ): cv.datetime,
25  vol.Optional(EVENT_IN): _EVENT_IN_TYPES,
26  },
27 )

Definition at line 114 of file __init__.py.

◆ CONF_CAL_ID

string homeassistant.components.google.CONF_CAL_ID = "cal_id"

Definition at line 62 of file __init__.py.

◆ CONF_IGNORE_AVAILABILITY

string homeassistant.components.google.CONF_IGNORE_AVAILABILITY = "ignore_availability"

Definition at line 65 of file __init__.py.

◆ CONF_MAX_RESULTS

string homeassistant.components.google.CONF_MAX_RESULTS = "max_results"

Definition at line 66 of file __init__.py.

◆ CONF_SEARCH

string homeassistant.components.google.CONF_SEARCH = "search"

Definition at line 64 of file __init__.py.

◆ CONF_TRACK

string homeassistant.components.google.CONF_TRACK = "track"

Definition at line 63 of file __init__.py.

◆ CONF_TRACK_NEW

string homeassistant.components.google.CONF_TRACK_NEW = "track_new_calendar"

Definition at line 60 of file __init__.py.

◆ CONFIG_SCHEMA

homeassistant.components.google.CONFIG_SCHEMA = vol.Schema(cv.removed(DOMAIN), extra=vol.ALLOW_EXTRA)

Definition at line 79 of file __init__.py.

◆ DEFAULT_CONF_OFFSET

string homeassistant.components.google.DEFAULT_CONF_OFFSET = "!!"

Definition at line 68 of file __init__.py.

◆ DEVICE_SCHEMA

homeassistant.components.google.DEVICE_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Required(CONF_CAL_ID): cv.string,
4  vol.Required(CONF_ENTITIES, None): vol.All(
5  cv.ensure_list, [_SINGLE_CALSEARCH_CONFIG]
6  ),
7  },
8  extra=vol.ALLOW_EXTRA,
9 )

Definition at line 97 of file __init__.py.

◆ ENTITY_ID_FORMAT

string homeassistant.components.google.ENTITY_ID_FORMAT = DOMAIN + ".{}"

Definition at line 58 of file __init__.py.

◆ EVENT_CALENDAR_ID

string homeassistant.components.google.EVENT_CALENDAR_ID = "calendar_id"

Definition at line 70 of file __init__.py.

◆ PLATFORMS

list homeassistant.components.google.PLATFORMS = [Platform.CALENDAR]

Definition at line 76 of file __init__.py.

◆ SERVICE_ADD_EVENT

string homeassistant.components.google.SERVICE_ADD_EVENT = "add_event"

Definition at line 72 of file __init__.py.

◆ YAML_DEVICES

string homeassistant.components.google.YAML_DEVICES = f"{DOMAIN}_calendars.yaml"

Definition at line 74 of file __init__.py.