Skip to content

Fix zero sensor values treated as unavailable#385

Open
Olen wants to merge 1 commit intomainfrom
fix/zero-value-treated-as-unavailable
Open

Fix zero sensor values treated as unavailable#385
Olen wants to merge 1 commit intomainfrom
fix/zero-value-treated-as-unavailable

Conversation

@Olen
Copy link
Owner

@Olen Olen commented Mar 24, 2026

Summary

  • Fixes limits are “not available” #383
  • not self._attr_native_value evaluates to True when value is 0, causing valid zero readings (e.g. conductivity 0 µS/cm) to be displayed as "unavailable"
  • Changed to self._attr_native_value is None in both PlantCurrentStatus.__init__ and PlantDummyStatus.__init__

Test plan

  • All 233 existing tests pass
  • Verify a plant with conductivity sensor reading 0 shows "0 µS/cm" instead of "Nicht verfügbar"

🤖 Generated with Claude Code

`not self._attr_native_value` evaluates to True when the value is 0,
causing valid zero readings (e.g. conductivity 0 µS/cm) to be reset
to the default state and displayed as "unavailable".

Use `is None` check instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

limits are “not available”

1 participant