Skip to content
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

Fix "referencing a non existing via_device" when gateway_external_id is None #573

Merged
merged 2 commits into from
Feb 10, 2025

Conversation

Moustachauve
Copy link
Contributor

@Moustachauve Moustachauve commented Feb 7, 2025

I tested on my end adding some logging and the only case it seems to be missing is when the device is the gateway itself.

The fix is to simply not set via_device when gateway_external_id is None. It's not really useful to specify a via_device when the "device" would basically be itself when we're talking about the gateway itself.

From the HA documentation:
via_device: Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant.
https://developers.home-assistant.io/docs/device_registry_index/#device-properties

This should fix #549.

@ic-dev21
Copy link
Collaborator

ic-dev21 commented Feb 9, 2025

Je teste sous peu! Thanks!

@ic-dev21 ic-dev21 merged commit e16eef6 into dvd-dev:main Feb 10, 2025
3 checks passed
@ic-dev21
Copy link
Collaborator

Fixes #549

@Moustachauve Moustachauve deleted the fix-for-549 branch February 10, 2025 05:13
ic-dev21 added a commit that referenced this pull request Feb 11, 2025
Fix "referencing a non existing `via_device`" when gateway_external_id is None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

device_registry.async_get_or_create deprecation
2 participants