Home Assistant Unofficial Reference 2024.12.1
homeassistant.auth.permissions.entities Namespace Reference

Functions

ValueType|None _lookup_area (PermissionLookup perm_lookup, SubCategoryDict area_dict, str entity_id)
 
ValueType|None _lookup_device (PermissionLookup perm_lookup, SubCategoryDict devices_dict, str entity_id)
 
ValueType|None _lookup_domain (PermissionLookup perm_lookup, SubCategoryDict domains_dict, str entity_id)
 
ValueType|None _lookup_entity_id (PermissionLookup perm_lookup, SubCategoryDict entities_dict, str entity_id)
 
Callable[[str, str], bool] compile_entities (CategoryType policy, PermissionLookup perm_lookup)
 

Variables

string ENTITY_AREAS = "area_ids"
 
string ENTITY_DEVICE_IDS = "device_ids"
 
string ENTITY_DOMAINS = "domains"
 
string ENTITY_ENTITY_IDS = "entity_ids"
 
 ENTITY_POLICY_SCHEMA
 
 ENTITY_VALUES_SCHEMA = vol.Any(True, vol.Schema({str: SINGLE_ENTITY_SCHEMA}))
 
 SINGLE_ENTITY_SCHEMA
 

Detailed Description

Entity permissions.

Function Documentation

◆ _lookup_area()

ValueType | None homeassistant.auth.permissions.entities._lookup_area ( PermissionLookup  perm_lookup,
SubCategoryDict  area_dict,
str   entity_id 
)
private
Look up entity permissions by area.

Definition at line 54 of file entities.py.

◆ _lookup_device()

ValueType | None homeassistant.auth.permissions.entities._lookup_device ( PermissionLookup  perm_lookup,
SubCategoryDict  devices_dict,
str   entity_id 
)
private
Look up entity permissions by device.

Definition at line 71 of file entities.py.

◆ _lookup_domain()

ValueType | None homeassistant.auth.permissions.entities._lookup_domain ( PermissionLookup  perm_lookup,
SubCategoryDict  domains_dict,
str   entity_id 
)
private
Look up entity permissions by domain.

Definition at line 47 of file entities.py.

◆ _lookup_entity_id()

ValueType | None homeassistant.auth.permissions.entities._lookup_entity_id ( PermissionLookup  perm_lookup,
SubCategoryDict  entities_dict,
str   entity_id 
)
private
Look up entity permission by entity id.

Definition at line 83 of file entities.py.

◆ compile_entities()

Callable[[str, str], bool] homeassistant.auth.permissions.entities.compile_entities ( CategoryType  policy,
PermissionLookup   perm_lookup 
)
Compile policy into a function that tests policy.

Definition at line 90 of file entities.py.

Variable Documentation

◆ ENTITY_AREAS

string homeassistant.auth.permissions.entities.ENTITY_AREAS = "area_ids"

Definition at line 27 of file entities.py.

◆ ENTITY_DEVICE_IDS

string homeassistant.auth.permissions.entities.ENTITY_DEVICE_IDS = "device_ids"

Definition at line 28 of file entities.py.

◆ ENTITY_DOMAINS

string homeassistant.auth.permissions.entities.ENTITY_DOMAINS = "domains"

Definition at line 26 of file entities.py.

◆ ENTITY_ENTITY_IDS

string homeassistant.auth.permissions.entities.ENTITY_ENTITY_IDS = "entity_ids"

Definition at line 29 of file entities.py.

◆ ENTITY_POLICY_SCHEMA

homeassistant.auth.permissions.entities.ENTITY_POLICY_SCHEMA
Initial value:
1 = vol.Any(
2  True,
3  vol.Schema(
4  {
5  vol.Optional(SUBCAT_ALL): SINGLE_ENTITY_SCHEMA,
6  vol.Optional(ENTITY_AREAS): ENTITY_VALUES_SCHEMA,
7  vol.Optional(ENTITY_DEVICE_IDS): ENTITY_VALUES_SCHEMA,
8  vol.Optional(ENTITY_DOMAINS): ENTITY_VALUES_SCHEMA,
9  vol.Optional(ENTITY_ENTITY_IDS): ENTITY_VALUES_SCHEMA,
10  }
11  ),
12 )

Definition at line 33 of file entities.py.

◆ ENTITY_VALUES_SCHEMA

homeassistant.auth.permissions.entities.ENTITY_VALUES_SCHEMA = vol.Any(True, vol.Schema({str: SINGLE_ENTITY_SCHEMA}))

Definition at line 31 of file entities.py.

◆ SINGLE_ENTITY_SCHEMA

homeassistant.auth.permissions.entities.SINGLE_ENTITY_SCHEMA
Initial value:
1 = vol.Any(
2  True,
3  vol.Schema(
4  {
5  vol.Optional(POLICY_READ): True,
6  vol.Optional(POLICY_CONTROL): True,
7  vol.Optional(POLICY_EDIT): True,
8  }
9  ),
10 )

Definition at line 15 of file entities.py.