Add network MAC connection to iAlarm device#173676
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 @RyuzakiKK, 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 entry for the iAlarm integration, improving device identification and enabling Home Assistant to better track the device via its MAC address.
Changes:
- Added
CONNECTION_NETWORK_MACandformat_macto theDeviceInfoinalarm_control_panel.pyto register the MAC as a device connection. - Added a new
test_device_registrytest to verify the device registry entry including the MAC connection. - Added a corresponding snapshot file for the new test.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| homeassistant/components/ialarm/alarm_control_panel.py | Adds MAC connection to DeviceInfo using format_mac |
| tests/components/ialarm/test_init.py | Adds test verifying the device registry entry with MAC connection |
| tests/components/ialarm/snapshots/test_init.ambr | Snapshot for the new device registry test |
Comment on lines
47
to
+48
| identifiers={(DOMAIN, coordinator.mac)}, | ||
| connections={(CONNECTION_NETWORK_MAC, format_mac(coordinator.mac))}, |
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 the iAlarm alarm panel 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: