Skip to content

Fix hw_version device info type#1808

Merged
AlexxIT merged 1 commit into
AlexxIT:masterfrom
hmmbob:codex/fix-hw-version-type
Jun 1, 2026
Merged

Fix hw_version device info type#1808
AlexxIT merged 1 commit into
AlexxIT:masterfrom
hmmbob:codex/fix-hw-version-type

Conversation

@hmmbob

@hmmbob hmmbob commented May 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Convert the Sonoff uiid value to a string before passing it as hw_version in DeviceInfo.
  • Add test coverage to assert hw_version is exposed as a string.

Why

Home Assistant now warns when custom integrations pass non-string values to the device registry for hw_version. Sonoff devices store extra.uiid as an integer, so this warning appears when entities are added.

Fixes #1804.

Validation

  • Applied the same change locally in my Home Assistant custom component setup and it works fine.
  • python3 -B -m py_compile custom_components/sonoff/core/entity.py tests/test_entity.py
  • python3 -m pytest tests -q in the Home Assistant container: 85 passed.

@hmmbob hmmbob marked this pull request as ready for review May 30, 2026 17:56
@AlexxIT AlexxIT merged commit 65f97da into AlexxIT:master Jun 1, 2026
2 checks passed
@AlexxIT

AlexxIT commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Thanks!

@hmmbob hmmbob deleted the codex/fix-hw-version-type branch June 1, 2026 04:38
@AlexxIT

AlexxIT commented Jun 7, 2026

Copy link
Copy Markdown
Owner

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.

Detected that custom integration 'sonoff' passes a non-string value of type int as hw_version to the device registry

2 participants