Skip to content

fix: Handle negative temperatures in sensor validation#81

Merged
alepee merged 1 commit intomainfrom
claude/plan-next-steps-wvyED
Feb 2, 2026
Merged

fix: Handle negative temperatures in sensor validation#81
alepee merged 1 commit intomainfrom
claude/plan-next-steps-wvyED

Conversation

@alepee
Copy link
Copy Markdown
Owner

@alepee alepee commented Feb 2, 2026

The previous validation using state.replace(".", "", 1).isdigit() rejected negative temperatures because the minus sign is not a digit. This caused the integration to fail during winter when temperatures drop below 0°C.

Replace with try/except float() conversion which properly handles:

  • Negative numbers (-5.2)
  • Scientific notation (1e-3)
  • All valid numeric formats

Fixes #76

https://claude.ai/code/session_01Pe2khoXmq3M1RQnHWjw79A

The previous validation using `state.replace(".", "", 1).isdigit()`
rejected negative temperatures because the minus sign is not a digit.
This caused the integration to fail during winter when temperatures
drop below 0°C.

Replace with try/except float() conversion which properly handles:
- Negative numbers (-5.2)
- Scientific notation (1e-3)
- All valid numeric formats

Fixes #76

https://claude.ai/code/session_01Pe2khoXmq3M1RQnHWjw79A
@alepee alepee merged commit a18550d into main Feb 2, 2026
0 of 6 checks passed
@alepee alepee deleted the claude/plan-next-steps-wvyED branch February 2, 2026 21:17
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.

Error reading sensor temperature

2 participants