Remove unifiprotect deprecate_package_sensor repair (#123807)

This commit is contained in:
J. Nick Koston 2024-08-13 06:56:10 -05:00 committed by GitHub
parent 2c4b7c2577
commit 2859dde697
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 18 deletions

View File

@ -107,20 +107,18 @@ async def async_migrate_data(
) -> None:
"""Run all valid UniFi Protect data migrations."""
_LOGGER.debug("Start Migrate: async_deprecate_hdr_package")
async_deprecate_hdr_package(hass, entry)
_LOGGER.debug("Completed Migrate: async_deprecate_hdr_package")
_LOGGER.debug("Start Migrate: async_deprecate_hdr")
async_deprecate_hdr(hass, entry)
_LOGGER.debug("Completed Migrate: async_deprecate_hdr")
@callback
def async_deprecate_hdr_package(hass: HomeAssistant, entry: UFPConfigEntry) -> None:
"""Check for usages of hdr_mode switch and package sensor and raise repair if it is used.
def async_deprecate_hdr(hass: HomeAssistant, entry: UFPConfigEntry) -> None:
"""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.
Additionally, the Package sensor is no longer functional due to how events work so a repair to notify users.
Added in 2024.4.0
"""
@ -128,11 +126,5 @@ def async_deprecate_hdr_package(hass: HomeAssistant, entry: UFPConfigEntry) -> N
hass,
entry,
"2024.10.0",
{
"hdr_switch": {"id": "hdr_mode", "platform": Platform.SWITCH},
"package_sensor": {
"id": "smart_obj_package",
"platform": Platform.BINARY_SENSOR,
},
},
{"hdr_switch": {"id": "hdr_mode", "platform": Platform.SWITCH}},
)

View File

@ -124,10 +124,6 @@
"deprecate_hdr_switch": {
"title": "HDR Mode Switch Deprecated",
"description": "UniFi Protect v3 added a new state for HDR (auto). As a result, the HDR Mode Switch has been replaced with an HDR Mode Select, and it is deprecated.\n\nBelow are the detected automations or scripts that use one or more of the deprecated entities:\n{items}\nThe above list may be incomplete and it does not include any template usages inside of dashboards. Please update any templates, automations or scripts accordingly."
},
"deprecate_package_sensor": {
"title": "Package Event Sensor Deprecated",
"description": "The package event sensor never tripped because of the way events are reported in UniFi Protect. As a result, the sensor is deprecated and will be removed.\n\nBelow are the detected automations or scripts that use one or more of the deprecated entities:\n{items}\nThe above list may be incomplete and it does not include any template usages inside of dashboards. Please update any templates, automations or scripts accordingly."
}
},
"entity": {