mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2026-10-27 16:10:49 +08:00
The description of the service was appended to the unique_id of the service entities without a migration step, so the entities registered before that change were replaced by new ones. The entity_id of the new entity is different, which silently breaks every automation, script and dashboard referring to the old one. Look up the entities that are still registered under the old unique_id when the entry is set up, and rewrite it in place. The entity_id is left untouched, so nothing referring to it has to be updated. The lookup is keyed on the unique_id only and scoped to the config entry, and nothing is written when the current unique_id is already registered, so it is idempotent and cannot replace an entity that is in use. An entity that cannot be migrated is reported and skipped, the others are still migrated. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>