Skip to content

Pin the device identity contract - #38

Open
drHouse-gif wants to merge 1 commit into
victronenergy:masterfrom
drHouse-gif:test/device-identity
Open

drHouse-gif wants to merge 1 commit into
victronenergy:masterfrom
drHouse-gif:test/device-identity

Conversation

@drHouse-gif

Copy link
Copy Markdown
Collaborator

The inventory is keyed by serial, which is the device's mac. An endpoint starts keyed by host and promote_endpoint_to_serial re-keys it once a probe reads the mac, merging into an existing serial-keyed entry rather than adding a second one. That merge is what stops one device appearing twice when it is both entered manually by IP and announced over mDNS, and nothing currently covers it.

Three tests: the same device from both sources is listed once with one channel; enabling that channel registers exactly one service rather than one per source; and two devices reporting the same mac collapse into a single stable entry.

The third is a characterisation test, not a fix. The mac is the only identity the Shelly RPC API offers, so two physically distinct devices reporting the same one take the same code path as one device reachable at two addresses, with the same signals available at promotion time. It asserts that the driver at least stays stable: one entry, one recorded host, holding rather than flapping.

No driver changes.

The inventory is keyed by serial, which is the device's mac. An endpoint
starts keyed by host and promote_endpoint_to_serial re-keys it once a
probe reads the mac, merging into an existing serial-keyed entry rather
than adding a second one. That merge is what stops one device appearing
twice when it is both entered manually by IP and announced over mDNS,
and nothing currently covers it.

Three tests: the same device from both sources is listed once with one
channel; enabling that channel registers exactly one service rather than
one per source; and two devices reporting the same mac collapse into a
single stable entry.

The third is a characterisation test, not a fix. The mac is the only
identity the Shelly RPC API offers, so two physically distinct devices
reporting the same one take the same code path as one device reachable at
two addresses, with the same signals available at promotion time. It
asserts that the driver at least stays stable: one entry, one recorded
host, holding rather than flapping.

No driver changes.
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.

1 participant