-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate wolflink config_entry unique_id to string #125653
Conversation
Hey there @adamkrol93, @mtielen, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
if isinstance(entry.unique_id, int): | ||
hass.config_entries.async_update_entry(entry, unique_id=str(entry.unique_id)) | ||
device_registry = dr.async_get(hass) | ||
for device in dr.async_entries_for_config_entry( | ||
device_registry, entry.entry_id | ||
): | ||
new_identifiers = set() | ||
for identifier in device.identifiers: | ||
if identifier[0] == DOMAIN: | ||
new_identifiers.add((DOMAIN, str(identifier[1]))) | ||
else: | ||
new_identifiers.add(identifier) | ||
device_registry.async_update_device( | ||
device.id, new_identifiers=new_identifiers | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use a minor migration for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use a minor migration for this?
done
Proposed change
SSIA, linked to #125313 and #125602
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: