Skip to content

fix: treat "None" as an inactive value sentinel - #1573

Merged
liudger merged 1 commit into
liudger:mainfrom
lmichelin:fix/none-inactive-sentinel
Aug 5, 2026
Merged

fix: treat "None" as an inactive value sentinel#1573
liudger merged 1 commit into
liudger:mainfrom
lmichelin:fix/none-inactive-sentinel

Conversation

@lmichelin

Copy link
Copy Markdown
Contributor

Fixes #1572.

BSB-LAN's replaceDisabled firmware setting decides what is sent for a deactivated numeric parameter. It defaults to "---", but Home Assistant's MQTT platform requires the literal string "None" to mark a sensor unknown (PAYLOAD_NONE); with "---", numeric MQTT sensors keep their last value forever. BSB-LAN's config file therefore tells Home Assistant users to set "None" — and doing so currently prevents this integration from starting (float_parsing on State.current_temperature.value).

As it stands, the two official HA paths for BSB-LAN need incompatible firmware settings. This adds "None" to the inactive sentinel set so a single device can serve both, and covers it in the existing parameterized test.

I deliberately kept this minimal and did not touch the "keep the raw string on conversion failure" behaviour, since it is explicitly asserted by three tests — see the issue for why I think it is nonetheless unsafe for parameterized EntityInfo[float] / EntityInfo[int] fields. Happy to follow up separately if you want that changed.

Full suite: 475 passed. (examples/speed_test.py errors on collection on main too, unrelated.)

BSB-LAN's `replaceDisabled` firmware setting decides what is sent for a
deactivated numeric parameter. It defaults to "---", but Home Assistant's
MQTT platform requires the literal string "None" to mark a sensor unknown
(PAYLOAD_NONE); with "---", numeric MQTT sensors keep their last value
forever instead of going unknown.

BSB-LAN's own BSB_LAN_config.h therefore tells Home Assistant users to set
"None", and doing so currently prevents this integration from starting with
a float_parsing error on State.current_temperature.value. The two official
Home Assistant paths for BSB-LAN thus require incompatible firmware
settings; accepting "None" as an inactive sentinel lets one device serve
both.

Refs #1572

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@liudger liudger added the bugfix Inconsistencies or issues which will cause a problem for users or implementers. label Aug 5, 2026
@liudger

liudger commented Aug 5, 2026

Copy link
Copy Markdown
Owner

This fix was on my todo list. Thanks @lmichelin

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (f35512f) to head (ef3a037).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1573   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines         1379      1379           
  Branches       150       150           
=========================================
  Hits          1379      1379           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@liudger
liudger merged commit e76d1a3 into liudger:main Aug 5, 2026
14 of 15 checks passed
@lmichelin
lmichelin deleted the fix/none-inactive-sentinel branch August 5, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Inconsistencies or issues which will cause a problem for users or implementers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

State validation fails when BSB-LAN's replaceDisabled is set to "None"

2 participants