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

Classes

class  APIComponentsView
 
class  APIConfigView
 
class  APICoreStateView
 
class  APIDomainServicesView
 
class  APIEntityStateView
 
class  APIErrorLog
 
class  APIEventListenersView
 
class  APIEventStream
 
class  APIEventView
 
class  APIServicesView
 
class  APIStatesView
 
class  APIStatusView
 
class  APITemplateView
 

Functions

template.Template _cached_template (str template_str, HomeAssistant hass)
 
list[dict[str, Any]] async_events_json (HomeAssistant hass)
 
list[dict[str, Any]] async_services_json (HomeAssistant hass)
 
bool async_setup (HomeAssistant hass, ConfigType config)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
string ATTR_BASE_URL = "base_url"
 
string ATTR_EXTERNAL_URL = "external_url"
 
string ATTR_INSTALLATION_TYPE = "installation_type"
 
string ATTR_INTERNAL_URL = "internal_url"
 
string ATTR_LOCATION_NAME = "location_name"
 
string ATTR_REQUIRES_API_PASSWORD = "requires_api_password"
 
string ATTR_UUID = "uuid"
 
string ATTR_VERSION = "version"
 
 CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)
 
string DOMAIN = "api"
 
int SERVICE_WAIT_TIMEOUT = 10
 
int STREAM_PING_INTERVAL = 50
 
string STREAM_PING_PAYLOAD = "ping"
 

Detailed Description

Rest API for Home Assistant.

Function Documentation

◆ _cached_template()

template.Template homeassistant.components.api._cached_template ( str  template_str,
HomeAssistant  hass 
)
private
Return a cached template.

Definition at line 466 of file __init__.py.

◆ async_events_json()

list[dict[str, Any]] homeassistant.components.api.async_events_json ( HomeAssistant  hass)
Generate event data to JSONify.

Definition at line 512 of file __init__.py.

◆ async_services_json()

list[dict[str, Any]] homeassistant.components.api.async_services_json ( HomeAssistant  hass)
Generate services data to JSONify.

Definition at line 505 of file __init__.py.

◆ async_setup()

bool homeassistant.components.api.async_setup ( HomeAssistant  hass,
ConfigType  config 
)
Register the API with the HTTP interface.

Definition at line 74 of file __init__.py.

Variable Documentation

◆ _LOGGER

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

Definition at line 55 of file __init__.py.

◆ ATTR_BASE_URL

string homeassistant.components.api.ATTR_BASE_URL = "base_url"

Definition at line 57 of file __init__.py.

◆ ATTR_EXTERNAL_URL

string homeassistant.components.api.ATTR_EXTERNAL_URL = "external_url"

Definition at line 58 of file __init__.py.

◆ ATTR_INSTALLATION_TYPE

string homeassistant.components.api.ATTR_INSTALLATION_TYPE = "installation_type"

Definition at line 61 of file __init__.py.

◆ ATTR_INTERNAL_URL

string homeassistant.components.api.ATTR_INTERNAL_URL = "internal_url"

Definition at line 59 of file __init__.py.

◆ ATTR_LOCATION_NAME

string homeassistant.components.api.ATTR_LOCATION_NAME = "location_name"

Definition at line 60 of file __init__.py.

◆ ATTR_REQUIRES_API_PASSWORD

string homeassistant.components.api.ATTR_REQUIRES_API_PASSWORD = "requires_api_password"

Definition at line 62 of file __init__.py.

◆ ATTR_UUID

string homeassistant.components.api.ATTR_UUID = "uuid"

Definition at line 63 of file __init__.py.

◆ ATTR_VERSION

string homeassistant.components.api.ATTR_VERSION = "version"

Definition at line 64 of file __init__.py.

◆ CONFIG_SCHEMA

homeassistant.components.api.CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)

Definition at line 71 of file __init__.py.

◆ DOMAIN

string homeassistant.components.api.DOMAIN = "api"

Definition at line 66 of file __init__.py.

◆ SERVICE_WAIT_TIMEOUT

int homeassistant.components.api.SERVICE_WAIT_TIMEOUT = 10

Definition at line 69 of file __init__.py.

◆ STREAM_PING_INTERVAL

int homeassistant.components.api.STREAM_PING_INTERVAL = 50

Definition at line 68 of file __init__.py.

◆ STREAM_PING_PAYLOAD

string homeassistant.components.api.STREAM_PING_PAYLOAD = "ping"

Definition at line 67 of file __init__.py.