Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.unifiprotect.migrate Namespace Reference

Classes

class  EntityRef
 
class  EntityUsage
 

Functions

None async_deprecate_hdr (HomeAssistant hass, UFPConfigEntry entry)
 
None async_migrate_data (HomeAssistant hass, UFPConfigEntry entry, ProtectApiClient protect, Bootstrap bootstrap)
 
dict[str, EntityUsagecheck_if_used (HomeAssistant hass, UFPConfigEntry entry, dict[str, EntityRef] entities)
 
None create_repair_if_used (HomeAssistant hass, UFPConfigEntry entry, str breaks_in, dict[str, EntityRef] entities)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 

Detailed Description

UniFi Protect data migrations.

Function Documentation

◆ async_deprecate_hdr()

None homeassistant.components.unifiprotect.migrate.async_deprecate_hdr ( HomeAssistant  hass,
UFPConfigEntry  entry 
)
Check for usages of hdr_mode switch and raise repair if it is used.

UniFi Protect v3.0.22 changed how HDR works so it is no longer a simple on/off toggle. There is
Always On, Always Off and Auto. So it has been migrated to a select. The old switch is now deprecated.

Added in 2024.4.0

Definition at line 116 of file migrate.py.

◆ async_migrate_data()

None homeassistant.components.unifiprotect.migrate.async_migrate_data ( HomeAssistant  hass,
UFPConfigEntry  entry,
ProtectApiClient  protect,
Bootstrap  bootstrap 
)
Run all valid UniFi Protect data migrations.

Definition at line 102 of file migrate.py.

◆ check_if_used()

dict[str, EntityUsage] homeassistant.components.unifiprotect.migrate.check_if_used ( HomeAssistant  hass,
UFPConfigEntry  entry,
dict[str, EntityRef]   entities 
)
Check for usages of entities and return them.

Definition at line 40 of file migrate.py.

◆ create_repair_if_used()

None homeassistant.components.unifiprotect.migrate.create_repair_if_used ( HomeAssistant  hass,
UFPConfigEntry  entry,
str  breaks_in,
dict[str, EntityRef entities 
)
Create repairs for used entities that are deprecated.

Definition at line 68 of file migrate.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.unifiprotect.migrate._LOGGER = logging.getLogger(__name__)
private

Definition at line 22 of file migrate.py.