Hi. I’m mantaining a custom integration that already set unique ids as for best practice.
We now found out that the value we use to set the unique_ids could change in some circumstances in ways out of our control (external provider can change them). We already come out with a better way to identify devices and we are ready to implement it. Thing is, we would like to have a “migration” plan to update the entities for those who already use the integration in order to avoid spamming them with duplicate entities.
Is it possible to programmatically change the unique_id for entities already in the registry?
If I try this, of course, it doesn’t work:
entity_registry = er.async_get(server.hass)
entities = er.async_entries_for_config_entry(entity_registry, entry.entry_id)
for entity in entities:
entity.unique_id = 'foo'
attr.exceptions.FrozenInstanceError
Thanks in advance