Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.homekit.aidmanager.AccessoryAidStorage Class Reference

Public Member Functions

None __init__ (self, HomeAssistant hass, str entry_id)
 
None async_initialize (self)
 
None async_save (self)
 
None async_schedule_save (self)
 
None delete_aid (self, str storage_key)
 
int get_or_allocate_aid (self, str|None unique_id, str entity_id)
 
int get_or_allocate_aid_for_entity_id (self, str entity_id)
 

Public Attributes

 allocated_aids
 
 allocations
 
 hass
 
 store
 

Private Member Functions

dict[str, dict[str, int]] _data_to_save (self)
 
None _migrate_unique_id_aid_assignment_if_needed (self, str sys_unique_id, er.RegistryEntry entry)
 

Private Attributes

 _entity_registry
 
 _entry_id
 

Detailed Description

Holds a map of entity ID to HomeKit ID.

Will generate new ID's, ensure they are unique and store them to make sure they
persist over reboots.

Definition at line 62 of file aidmanager.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.homekit.aidmanager.AccessoryAidStorage.__init__ (   self,
HomeAssistant  hass,
str  entry_id 
)
Create a new entity map store.

Definition at line 69 of file aidmanager.py.

Member Function Documentation

◆ _data_to_save()

dict[str, dict[str, int]] homeassistant.components.homekit.aidmanager.AccessoryAidStorage._data_to_save (   self)
private
Return data of entity map to store in a file.

Definition at line 155 of file aidmanager.py.

◆ _migrate_unique_id_aid_assignment_if_needed()

None homeassistant.components.homekit.aidmanager.AccessoryAidStorage._migrate_unique_id_aid_assignment_if_needed (   self,
str  sys_unique_id,
er.RegistryEntry   entry 
)
private
Migrate the unique id aid assignment if its changed.

Definition at line 99 of file aidmanager.py.

◆ async_initialize()

None homeassistant.components.homekit.aidmanager.AccessoryAidStorage.async_initialize (   self)
Load the latest AID data.

Definition at line 78 of file aidmanager.py.

◆ async_save()

None homeassistant.components.homekit.aidmanager.AccessoryAidStorage.async_save (   self)
Save the entity map cache.

Definition at line 149 of file aidmanager.py.

◆ async_schedule_save()

None homeassistant.components.homekit.aidmanager.AccessoryAidStorage.async_schedule_save (   self)
Schedule saving the entity map cache.

Definition at line 144 of file aidmanager.py.

◆ delete_aid()

None homeassistant.components.homekit.aidmanager.AccessoryAidStorage.delete_aid (   self,
str  storage_key 
)
Delete an aid allocation.

Definition at line 134 of file aidmanager.py.

◆ get_or_allocate_aid()

int homeassistant.components.homekit.aidmanager.AccessoryAidStorage.get_or_allocate_aid (   self,
str | None  unique_id,
str  entity_id 
)
Allocate (and return) a new aid for an accessory.

Definition at line 112 of file aidmanager.py.

◆ get_or_allocate_aid_for_entity_id()

int homeassistant.components.homekit.aidmanager.AccessoryAidStorage.get_or_allocate_aid_for_entity_id (   self,
str  entity_id 
)
Generate a stable aid for an entity id.

Definition at line 90 of file aidmanager.py.

Member Data Documentation

◆ _entity_registry

homeassistant.components.homekit.aidmanager.AccessoryAidStorage._entity_registry
private

Definition at line 76 of file aidmanager.py.

◆ _entry_id

homeassistant.components.homekit.aidmanager.AccessoryAidStorage._entry_id
private

Definition at line 74 of file aidmanager.py.

◆ allocated_aids

homeassistant.components.homekit.aidmanager.AccessoryAidStorage.allocated_aids

Definition at line 88 of file aidmanager.py.

◆ allocations

homeassistant.components.homekit.aidmanager.AccessoryAidStorage.allocations

Definition at line 87 of file aidmanager.py.

◆ hass

homeassistant.components.homekit.aidmanager.AccessoryAidStorage.hass

Definition at line 71 of file aidmanager.py.

◆ store

homeassistant.components.homekit.aidmanager.AccessoryAidStorage.store

Definition at line 81 of file aidmanager.py.


The documentation for this class was generated from the following file: