Fix repair when integration does not exist (#127050)

This commit is contained in:
Shai Ungar 2024-09-30 10:17:44 +03:00 committed by Franck Nijhof
parent b42848fd7a
commit 62629a0b34
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

View File

@ -42,8 +42,8 @@ async def async_create_fix_flow(
hass: HomeAssistant, issue_id: str, data: dict
) -> RepairsFlow:
"""Create flow."""
if issue_id.startswith("deprecate_sensor_"):
entry = hass.config_entries.async_get_entry(data["entry_id"])
assert entry
if issue_id.startswith("deprecate_sensor_") and (
entry := hass.config_entries.async_get_entry(data["entry_id"])
):
return SensorDeprecationRepairFlow(entry)
return ConfirmRepairFlow()