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

Namespaces

 config_flow
 
 const
 
 device_tracker
 

Functions

str _address (str value)
 
def _device_name (data)
 
def _is_mobile_beacon (data, mobile_beacons)
 
def _set_location (hass, data, location_name)
 
bool async_setup (HomeAssistant hass, ConfigType hass_config)
 
bool async_setup_entry (HomeAssistant hass, ConfigEntry entry)
 
bool async_unload_entry (HomeAssistant hass, ConfigEntry entry)
 
web.Response handle_webhook (HomeAssistant hass, str webhook_id, web.Request request)
 

Variables

 async_remove_entry = config_entry_flow.webhook_async_remove_entry
 
string ATTR_ADDRESS = "address"
 
string ATTR_BEACON_ID = "beaconUUID"
 
string ATTR_CURRENT_LATITUDE = "currentLatitude"
 
string ATTR_CURRENT_LONGITUDE = "currentLongitude"
 
string ATTR_DEVICE = "device"
 
string ATTR_ENTRY = "entry"
 
string BEACON_DEV_PREFIX = "beacon"
 
string CONF_MOBILE_BEACONS = "mobile_beacons"
 
 CONFIG_SCHEMA
 
string LOCATION_ENTRY = "1"
 
string LOCATION_EXIT = "0"
 
list PLATFORMS = [Platform.DEVICE_TRACKER]
 
string TRACKER_UPDATE = f"{DOMAIN}_tracker_update"
 
 WEBHOOK_SCHEMA
 

Detailed Description

Support for Geofency.

Function Documentation

◆ _address()

str homeassistant.components.geofency._address ( str  value)
private
Coerce address by replacing '\n' with ' '.

Definition at line 59 of file __init__.py.

◆ _device_name()

def homeassistant.components.geofency._device_name (   data)
private
Return name of device tracker.

Definition at line 121 of file __init__.py.

◆ _is_mobile_beacon()

def homeassistant.components.geofency._is_mobile_beacon (   data,
  mobile_beacons 
)
private
Check if we have a mobile beacon.

Definition at line 116 of file __init__.py.

◆ _set_location()

def homeassistant.components.geofency._set_location (   hass,
  data,
  location_name 
)
private
Fire HA event to set location.

Definition at line 128 of file __init__.py.

◆ async_setup()

bool homeassistant.components.geofency.async_setup ( HomeAssistant  hass,
ConfigType  hass_config 
)
Set up the Geofency component.

Definition at line 80 of file __init__.py.

◆ async_setup_entry()

bool homeassistant.components.geofency.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Configure based on config entry.

Definition at line 144 of file __init__.py.

◆ async_unload_entry()

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

Definition at line 154 of file __init__.py.

◆ handle_webhook()

web.Response homeassistant.components.geofency.handle_webhook ( HomeAssistant  hass,
str  webhook_id,
web.Request   request 
)
Handle incoming webhook from Geofency.

Definition at line 92 of file __init__.py.

Variable Documentation

◆ async_remove_entry

homeassistant.components.geofency.async_remove_entry = config_entry_flow.webhook_async_remove_entry

Definition at line 161 of file __init__.py.

◆ ATTR_ADDRESS

string homeassistant.components.geofency.ATTR_ADDRESS = "address"

Definition at line 44 of file __init__.py.

◆ ATTR_BEACON_ID

string homeassistant.components.geofency.ATTR_BEACON_ID = "beaconUUID"

Definition at line 45 of file __init__.py.

◆ ATTR_CURRENT_LATITUDE

string homeassistant.components.geofency.ATTR_CURRENT_LATITUDE = "currentLatitude"

Definition at line 46 of file __init__.py.

◆ ATTR_CURRENT_LONGITUDE

string homeassistant.components.geofency.ATTR_CURRENT_LONGITUDE = "currentLongitude"

Definition at line 47 of file __init__.py.

◆ ATTR_DEVICE

string homeassistant.components.geofency.ATTR_DEVICE = "device"

Definition at line 48 of file __init__.py.

◆ ATTR_ENTRY

string homeassistant.components.geofency.ATTR_ENTRY = "entry"

Definition at line 49 of file __init__.py.

◆ BEACON_DEV_PREFIX

string homeassistant.components.geofency.BEACON_DEV_PREFIX = "beacon"

Definition at line 51 of file __init__.py.

◆ CONF_MOBILE_BEACONS

string homeassistant.components.geofency.CONF_MOBILE_BEACONS = "mobile_beacons"

Definition at line 29 of file __init__.py.

◆ CONFIG_SCHEMA

homeassistant.components.geofency.CONFIG_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Optional(DOMAIN): vol.Schema(
4  {
5  vol.Optional(CONF_MOBILE_BEACONS, default=[]): vol.All(
6  cv.ensure_list, [cv.string]
7  )
8  }
9  )
10  },
11  extra=vol.ALLOW_EXTRA,
12 )

Definition at line 31 of file __init__.py.

◆ LOCATION_ENTRY

string homeassistant.components.geofency.LOCATION_ENTRY = "1"

Definition at line 53 of file __init__.py.

◆ LOCATION_EXIT

string homeassistant.components.geofency.LOCATION_EXIT = "0"

Definition at line 54 of file __init__.py.

◆ PLATFORMS

list homeassistant.components.geofency.PLATFORMS = [Platform.DEVICE_TRACKER]

Definition at line 27 of file __init__.py.

◆ TRACKER_UPDATE

string homeassistant.components.geofency.TRACKER_UPDATE = f"{DOMAIN}_tracker_update"

Definition at line 56 of file __init__.py.

◆ WEBHOOK_SCHEMA

homeassistant.components.geofency.WEBHOOK_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Required(ATTR_ADDRESS): vol.All(cv.string, _address),
4  vol.Required(ATTR_DEVICE): vol.All(cv.string, slugify),
5  vol.Required(ATTR_ENTRY): vol.Any(LOCATION_ENTRY, LOCATION_EXIT),
6  vol.Required(ATTR_LATITUDE): cv.latitude,
7  vol.Required(ATTR_LONGITUDE): cv.longitude,
8  vol.Required(ATTR_NAME): vol.All(cv.string, slugify),
9  vol.Optional(ATTR_CURRENT_LATITUDE): cv.latitude,
10  vol.Optional(ATTR_CURRENT_LONGITUDE): cv.longitude,
11  vol.Optional(ATTR_BEACON_ID): cv.string,
12  },
13  extra=vol.ALLOW_EXTRA,
14 )

Definition at line 64 of file __init__.py.