Home Assistant Unofficial Reference 2024.12.1
homeassistant.helpers.area_registry.AreaRegistry Class Reference
Inheritance diagram for homeassistant.helpers.area_registry.AreaRegistry:
[legend]
Collaboration diagram for homeassistant.helpers.area_registry.AreaRegistry:
[legend]

Public Member Functions

None __init__ (self, HomeAssistant hass)
 
AreaEntry async_create (self, str name, *set[str]|None aliases=None, str|None floor_id=None, str|None icon=None, set[str]|None labels=None, str|None picture=None)
 
None async_delete (self, str area_id)
 
AreaEntry|None async_get_area (self, str area_id)
 
AreaEntry|None async_get_area_by_name (self, str name)
 
AreaEntry async_get_or_create (self, str name)
 
Iterable[AreaEntryasync_list_areas (self)
 
None async_load (self)
 
AreaEntry async_update (self, str area_id, *set[str]|UndefinedType aliases=UNDEFINED, str|None|UndefinedType floor_id=UNDEFINED, str|None|UndefinedType icon=UNDEFINED, set[str]|UndefinedType labels=UNDEFINED, str|UndefinedType name=UNDEFINED, str|None|UndefinedType picture=UNDEFINED)
 

Public Attributes

 areas
 
 hass
 

Private Member Functions

None _async_setup_cleanup (self)
 
AreaEntry _async_update (self, str area_id, *set[str]|UndefinedType aliases=UNDEFINED, str|None|UndefinedType floor_id=UNDEFINED, str|None|UndefinedType icon=UNDEFINED, set[str]|UndefinedType labels=UNDEFINED, str|UndefinedType name=UNDEFINED, str|None|UndefinedType picture=UNDEFINED)
 
AreasRegistryStoreData _data_to_save (self)
 
str _generate_id (self, str name)
 

Private Attributes

 _area_data
 
 _store
 

Detailed Description

Class to hold a registry of areas.

Definition at line 191 of file area_registry.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.helpers.area_registry.AreaRegistry.__init__ (   self,
HomeAssistant  hass 
)
Initialize the area registry.

Definition at line 197 of file area_registry.py.

Member Function Documentation

◆ _async_setup_cleanup()

None homeassistant.helpers.area_registry.AreaRegistry._async_setup_cleanup (   self)
private
Set up the area registry cleanup.

Definition at line 414 of file area_registry.py.

◆ _async_update()

AreaEntry homeassistant.helpers.area_registry.AreaRegistry._async_update (   self,
str  area_id,
*set[str] | UndefinedType   aliases = UNDEFINED,
str | None | UndefinedType   floor_id = UNDEFINED,
str | None | UndefinedType   icon = UNDEFINED,
set[str] | UndefinedType   labels = UNDEFINED,
str | UndefinedType   name = UNDEFINED,
str | None | UndefinedType   picture = UNDEFINED 
)
private
Update name of area.

Definition at line 327 of file area_registry.py.

◆ _data_to_save()

AreasRegistryStoreData homeassistant.helpers.area_registry.AreaRegistry._data_to_save (   self)
private
Return data of area registry to store in a file.

Definition at line 394 of file area_registry.py.

◆ _generate_id()

str homeassistant.helpers.area_registry.AreaRegistry._generate_id (   self,
str  name 
)
private
Generate area ID.

Definition at line 234 of file area_registry.py.

◆ async_create()

AreaEntry homeassistant.helpers.area_registry.AreaRegistry.async_create (   self,
str  name,
*set[str] | None   aliases = None,
str | None   floor_id = None,
str | None   icon = None,
set[str] | None   labels = None,
str | None   picture = None 
)
Create a new area.

Definition at line 239 of file area_registry.py.

◆ async_delete()

None homeassistant.helpers.area_registry.AreaRegistry.async_delete (   self,
str  area_id 
)
Delete area.

Definition at line 277 of file area_registry.py.

◆ async_get_area()

AreaEntry | None homeassistant.helpers.area_registry.AreaRegistry.async_get_area (   self,
str  area_id 
)
Get area by id.

We retrieve the DeviceEntry from the underlying dict to avoid
the overhead of the UserDict __getitem__.

Definition at line 209 of file area_registry.py.

◆ async_get_area_by_name()

AreaEntry | None homeassistant.helpers.area_registry.AreaRegistry.async_get_area_by_name (   self,
str  name 
)
Get area by name.

Definition at line 218 of file area_registry.py.

◆ async_get_or_create()

AreaEntry homeassistant.helpers.area_registry.AreaRegistry.async_get_or_create (   self,
str  name 
)
Get or create an area.

Definition at line 228 of file area_registry.py.

◆ async_list_areas()

Iterable[AreaEntry] homeassistant.helpers.area_registry.AreaRegistry.async_list_areas (   self)
Get all areas.

Definition at line 223 of file area_registry.py.

◆ async_load()

None homeassistant.helpers.area_registry.AreaRegistry.async_load (   self)
Load the area registry.

Definition at line 367 of file area_registry.py.

◆ async_update()

AreaEntry homeassistant.helpers.area_registry.AreaRegistry.async_update (   self,
str  area_id,
*set[str] | UndefinedType   aliases = UNDEFINED,
str | None | UndefinedType   floor_id = UNDEFINED,
str | None | UndefinedType   icon = UNDEFINED,
set[str] | UndefinedType   labels = UNDEFINED,
str | UndefinedType   name = UNDEFINED,
str | None | UndefinedType   picture = UNDEFINED 
)
Update name of area.

Definition at line 295 of file area_registry.py.

Member Data Documentation

◆ _area_data

homeassistant.helpers.area_registry.AreaRegistry._area_data
private

Definition at line 391 of file area_registry.py.

◆ _store

homeassistant.helpers.area_registry.AreaRegistry._store
private

Definition at line 200 of file area_registry.py.

◆ areas

homeassistant.helpers.area_registry.AreaRegistry.areas

Definition at line 390 of file area_registry.py.

◆ hass

homeassistant.helpers.area_registry.AreaRegistry.hass

Definition at line 199 of file area_registry.py.


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