Skip to content

fix: guard against None in data_collection projected_temperature round() - #10

Merged
Gamso merged 2 commits into
feat/add-mpc-algofrom
copilot/fix-climate-entity-error
May 28, 2026
Merged

Gamso merged 2 commits into
feat/add-mpc-algofrom
copilot/fix-climate-entity-error

Conversation

@Gamso

@Gamso Gamso commented May 25, 2026

Copy link
Copy Markdown
Owner

Copilot AI review requested due to automatic review settings May 25, 2026 14:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the CSV data logger (DataCollector) to avoid runtime errors when projected_temperature (and related projected error) are present in the controller decision payload but set to None, which would previously raise during round().

Changes:

  • Added a small _coalesce() helper to substitute defaults when a value is None.
  • Updated CSV row construction to coalesce projected_temperature and projected_temperature_error before rounding.

Comment thread custom_components/smart_fan_controller/data_collection.py
Copilot finished work on behalf of Gamso May 28, 2026 20:59
@Gamso
Gamso merged commit 985328e into feat/add-mpc-algo May 28, 2026
2 checks passed
@Gamso
Gamso deleted the copilot/fix-climate-entity-error branch July 4, 2026 16:44
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.

3 participants