Add network MAC connection to Renson devices#173677
Draft
jasonjhofmann wants to merge 1 commit into
Draft
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Hey there @jimmyd-be, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds a network MAC connection to the device registry for the Renson integration, enabling Home Assistant to identify and link devices by their MAC address in addition to the existing identifier.
Changes:
- Added
CONNECTION_NETWORK_MACandformat_macto the device info inentity.pyso the device registry includes a MAC-based connection. - Added a new test in
test_init.pyto verify the device registry entry includes the MAC connection. - Added a corresponding snapshot file for the new test assertion.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| homeassistant/components/renson/entity.py | Imports CONNECTION_NETWORK_MAC and format_mac, and adds a connections set with the formatted MAC to the DeviceInfo. |
| tests/components/renson/test_init.py | New test file verifying the device registry entry, including the MAC connection, via snapshot assertion. |
| tests/components/renson/snapshots/test_init.ambr | Snapshot for the new device registry test, including expected connections and identifiers. |
Comment on lines
32
to
+40
| identifiers={ | ||
| (DOMAIN, api.get_field_value(coordinator.data, MAC_ADDRESS.name)) | ||
| }, | ||
| connections={ | ||
| ( | ||
| CONNECTION_NETWORK_MAC, | ||
| format_mac(api.get_field_value(coordinator.data, MAC_ADDRESS.name)), | ||
| ) | ||
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Register Renson ventilation units with its network MAC address as a connection so the MAC is
shown on the device page and other integrations can attach to the same device.
The device was registered without any device
connections, so Home Assistant didnot display the MAC on the device page, and integrations that key off the network
MAC (for example, the UniFi Network integration) created a separate device for the
same physical unit. Adding the
CONNECTION_NETWORK_MACconnection fixes both: theMAC now shows on the device page, and integrations referencing the same network
device link to it instead of producing a duplicate.
This is the same change applied to Aranet in #173066 and to AirVisual Pro in
#173071.
Please re-classify it as a Bugfix if deemed appropriate (as one could argue a
network device should always carry its network MAC connection).
The change is covered by a new device-registry snapshot test that asserts the
network MAC connection is registered.
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: