Skip to content

fix: Device.as_dict() raised TypeError for any device with a node - #88

Merged
dcj merged 1 commit into
mainfrom
dcj/device-as-dict-fix
Oct 4, 2026
Merged

dcj merged 1 commit into
mainfrom
dcj/device-as-dict-fix

Conversation

@dcj

@dcj dcj commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #87.

homie.Device.as_dict() built each node entry as a set literal, {node_id, node.as_dict()}, so it raised TypeError: unhashable type: 'dict' for any device with a node. Now nodes[node_id] = node.as_dict(), with a regression test that fails before the fix.

The CHANGELOG entry sits under [Unreleased] next to #86's; whichever merges second needs a rebase.

🤖 Generated with Claude Code

https://claude.ai/code/session_01T32pvgqCzp1qCz7K5gS9Wm

It built each node entry as a set literal, {node_id, node.as_dict()},
which hashes the node's dict. Adds a regression test with a node; a device
with no nodes returned normally, which is why nothing caught it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T32pvgqCzp1qCz7K5gS9Wm
@dcj
dcj force-pushed the dcj/device-as-dict-fix branch from bf5276a to f307e83 Compare October 4, 2026 05:57
@dcj
dcj merged commit f93ef05 into main Oct 4, 2026
5 checks passed
@dcj
dcj deleted the dcj/device-as-dict-fix branch October 4, 2026 05:58
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.as_dict() raises TypeError for any device with a node

1 participant