-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
Add zwave to ozw migration #39081
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
Add zwave to ozw migration #39081
Conversation
Hey there @home-assistant/z-wave, mind taking a look at this pull request as its been labeled with an integration ( |
Hey there @cgarwood, @marcelveldt, mind taking a look at this pull request as its been labeled with an integration ( |
We'll also need to check if they have a |
fb9ab0c
to
3dfcd1d
Compare
bb3847f
to
6ec340d
Compare
dd8a9bf
to
702489b
Compare
async def async_migrate(hass, migration_map): | ||
"""Perform zwave to ozw migration.""" | ||
dev_reg = await async_get_device_registry(hass) | ||
for ozw_device_id, zwave_device_id in migration_map["device_entries"].items(): |
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.
Why are we migrating info between devices instead of merging them ? A device can be linked to multiple integrations: https://developers.home-assistant.io/docs/device_registry_index
Calling dev_reg.async_get_or_create
with identifiers of both devices will link them up. We find by identifier first, so you just call dev_reg.async_get_or_create
with the Z-Wave device ID first, so it gets OZW one added. Then delete OZW device ID.
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.
(this works too, so fine with it)
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.
We'd have to look up the device identifiers first to do that, right? So it looks like the current way is easier.
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.
Yeah, you will need to find both entries first anyway.
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.
We should apply this suggestion to solve the migration of device actions etc.
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.
We've decided to not add more to this migration, consider the recent move with zwave_js.
197eaa2
to
9a5ba31
Compare
We'll wait to merge until we have confirmation from frontend that we have all that is needed in the backend. CC @bramkragten |
e02de06
to
4f9760a
Compare
I'll need to look into the meter and notification command class migration. It doesn't work consistently for all users. |
Co-authored-by: Paulus Schoutsen <[email protected]>
4f9760a
to
0a65868
Compare
* 'dev' of https://github.com/home-assistant/core: (98 commits) Bump pymyq to 2.0.13 (home-assistant#44961) Add zwave to ozw migration (home-assistant#39081) Add pressure forecast to HA weather entity model (home-assistant#44965) Deduplicate MQTT entity discovery code (home-assistant#44970) Fix parameters when toggling light (home-assistant#44950) Move MQTT entity helpers to separate file (home-assistant#44838) Helpers type hint improvements (home-assistant#44964) Remove script/test (home-assistant#44967) Add MQTT Number (non optimistic) (home-assistant#44883) Fix Netatmo climate boost for valves (home-assistant#44957) Disambiguate Supervisor HTTPUnauthorized on user/password validation (home-assistant#44940) Add torrent id to Transmission events (home-assistant#44187) Prefix versions in system health (home-assistant#44921) Fix media renderers without volume control (home-assistant#44874) Fix wait_template incorrectly matching falsey values (home-assistant#44938) Upgrade youtube_dl to 2021.01.03 (home-assistant#44942) Upgrade discord.py to 1.6.0 (home-assistant#44941) Fix KNX cover state return open when unknown (home-assistant#44926) Use parent_id to find cause of logbook events with new contexts (home-assistant#44416) Implement support for additional ecobee hold modes (home-assistant#40520) ...
Is it possible that this PR is causing the behavior that is being seen in this issue? #46679 If so, I think this is an edge case where this is a breaking change for the zwave component. |
@sbruggeman Please do not use handled PRs for handling issues. There is an issue, that is sufficient. Thanks 👍 |
Breaking change
Proposed change
name_by_user
andarea_id
in the device registry should be migrated.TODO
Type of change
Example entry for
configuration.yaml
:# Example configuration.yaml
Additional information
Checklist
black --fast 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
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: