diff --git a/homeassistant/components/min_max/repairs.py b/homeassistant/components/min_max/repairs.py index 0677a820e5c2..01f18d2fdf1e 100644 --- a/homeassistant/components/min_max/repairs.py +++ b/homeassistant/components/min_max/repairs.py @@ -47,7 +47,8 @@ class MigrateToGroupSensorFlow(RepairsFlow): old_entity = entity_reg.async_get_entity_id( SENSOR_DOMAIN, DOMAIN, self.entry.entry_id ) - assert old_entity + if not old_entity: + return self.async_abort(reason="entity_not_found") if user_input is not None: config = dict(self.entry.options) diff --git a/homeassistant/components/min_max/strings.json b/homeassistant/components/min_max/strings.json index 29d9db0202be..93fbfa834123 100644 --- a/homeassistant/components/min_max/strings.json +++ b/homeassistant/components/min_max/strings.json @@ -13,6 +13,9 @@ "issues": { "migrate_to_group_sensor": { "fix_flow": { + "abort": { + "entity_not_found": "Entity could not be found, please restart repairing the issue." + }, "step": { "migrate": { "description": "The Min/Max helper has been deprecated and {title} will be migrated to a group sensor when you click submit to fix this repair.",