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

Namespaces

 config_flow
 
 const
 
 trigger
 

Classes

class  Zone
 
class  ZoneStorageCollection
 

Functions

dict _home_conf (HomeAssistant hass)
 
State|None async_active_zone (HomeAssistant hass, float latitude, float longitude, int radius=0)
 
bool async_setup (HomeAssistant hass, ConfigType config)
 
bool async_setup_entry (HomeAssistant hass, config_entries.ConfigEntry config_entry)
 
None async_setup_track_zone_entity_ids (HomeAssistant hass)
 
bool async_unload_entry (HomeAssistant hass, config_entries.ConfigEntry config_entry)
 
Any empty_value (Any value)
 
bool in_zone (State zone, float latitude, float longitude, float radius=0)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
 CONF_PASSIVE
 
 CONF_RADIUS
 
 CONFIG_SCHEMA
 
 default
 
bool DEFAULT_PASSIVE = False
 
int DEFAULT_RADIUS = 100
 
string ENTITY_ID_FORMAT = "zone.{}"
 
string ENTITY_ID_HOME = ENTITY_ID_FORMAT.format(HOME_ZONE)
 
 ENTITY_ID_SORTER = attrgetter("entity_id")
 
string ICON_HOME = "mdi:home"
 
string ICON_IMPORT = "mdi:import"
 
 RELOAD_SERVICE_SCHEMA = vol.Schema({})
 
 STORAGE_KEY = DOMAIN
 
int STORAGE_VERSION = 1
 
 VolDictType
 
string ZONE_ENTITY_IDS = "zone_entity_ids"
 

Detailed Description

Support for the definition of zones.

Function Documentation

◆ _home_conf()

dict homeassistant.components.zone._home_conf ( HomeAssistant  hass)
private
Return the home zone config.

Definition at line 299 of file __init__.py.

◆ async_active_zone()

State | None homeassistant.components.zone.async_active_zone ( HomeAssistant  hass,
float  latitude,
float  longitude,
int   radius = 0 
)
Find the active zone for given latitude, longitude.

This method must be run in the event loop.

Definition at line 113 of file __init__.py.

◆ async_setup()

bool homeassistant.components.zone.async_setup ( HomeAssistant  hass,
ConfigType  config 
)
Set up configured zones as well as Home Assistant zone if necessary.

Definition at line 234 of file __init__.py.

◆ async_setup_entry()

bool homeassistant.components.zone.async_setup_entry ( HomeAssistant  hass,
config_entries.ConfigEntry   config_entry 
)
Set up zone as config entry.

Definition at line 311 of file __init__.py.

◆ async_setup_track_zone_entity_ids()

None homeassistant.components.zone.async_setup_track_zone_entity_ids ( HomeAssistant  hass)
Set up track of entity IDs for zones.

Definition at line 169 of file __init__.py.

◆ async_unload_entry()

bool homeassistant.components.zone.async_unload_entry ( HomeAssistant  hass,
config_entries.ConfigEntry   config_entry 
)
Will be called once we remove it.

Definition at line 330 of file __init__.py.

◆ empty_value()

Any homeassistant.components.zone.empty_value ( Any  value)
Test if the user has the default config value from adding "zone:".

Definition at line 85 of file __init__.py.

◆ in_zone()

bool homeassistant.components.zone.in_zone ( State  zone,
float  latitude,
float  longitude,
float   radius = 0 
)
Test if given latitude, longitude is in given zone.

Async friendly.

Definition at line 193 of file __init__.py.

Variable Documentation

◆ _LOGGER

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

Definition at line 54 of file __init__.py.

◆ CONF_PASSIVE

homeassistant.components.zone.CONF_PASSIVE

Definition at line 70 of file __init__.py.

◆ CONF_RADIUS

homeassistant.components.zone.CONF_RADIUS

Definition at line 69 of file __init__.py.

◆ CONFIG_SCHEMA

homeassistant.components.zone.CONFIG_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Optional(DOMAIN, default=[]): vol.Any(
4  vol.All(cv.ensure_list, [vol.Schema(CREATE_FIELDS)]),
5  empty_value,
6  )
7  },
8  extra=vol.ALLOW_EXTRA,
9 )

Definition at line 93 of file __init__.py.

◆ default

homeassistant.components.zone.default

Definition at line 69 of file __init__.py.

◆ DEFAULT_PASSIVE

bool homeassistant.components.zone.DEFAULT_PASSIVE = False

Definition at line 56 of file __init__.py.

◆ DEFAULT_RADIUS

int homeassistant.components.zone.DEFAULT_RADIUS = 100

Definition at line 57 of file __init__.py.

◆ ENTITY_ID_FORMAT

string homeassistant.components.zone.ENTITY_ID_FORMAT = "zone.{}"

Definition at line 59 of file __init__.py.

◆ ENTITY_ID_HOME

string homeassistant.components.zone.ENTITY_ID_HOME = ENTITY_ID_FORMAT.format(HOME_ZONE)

Definition at line 60 of file __init__.py.

◆ ENTITY_ID_SORTER

homeassistant.components.zone.ENTITY_ID_SORTER = attrgetter("entity_id")

Definition at line 107 of file __init__.py.

◆ ICON_HOME

string homeassistant.components.zone.ICON_HOME = "mdi:home"

Definition at line 62 of file __init__.py.

◆ ICON_IMPORT

string homeassistant.components.zone.ICON_IMPORT = "mdi:import"

Definition at line 63 of file __init__.py.

◆ RELOAD_SERVICE_SCHEMA

homeassistant.components.zone.RELOAD_SERVICE_SCHEMA = vol.Schema({})

Definition at line 103 of file __init__.py.

◆ STORAGE_KEY

homeassistant.components.zone.STORAGE_KEY = DOMAIN

Definition at line 104 of file __init__.py.

◆ STORAGE_VERSION

int homeassistant.components.zone.STORAGE_VERSION = 1

Definition at line 105 of file __init__.py.

◆ VolDictType

homeassistant.components.zone.VolDictType

Definition at line 65 of file __init__.py.

◆ ZONE_ENTITY_IDS

string homeassistant.components.zone.ZONE_ENTITY_IDS = "zone_entity_ids"

Definition at line 109 of file __init__.py.