Skip to content

Release v7.3.4 - Fix Temperature Delta Conversions#68

Merged
eman merged 2 commits intomainfrom
7.3.4-release
Jan 27, 2026
Merged

Release v7.3.4 - Fix Temperature Delta Conversions#68
eman merged 2 commits intomainfrom
7.3.4-release

Conversation

@eman
Copy link
Copy Markdown
Owner

@eman eman commented Jan 27, 2026

Summary

  • Fixed incorrect Fahrenheit conversion for differential temperature settings (heat pump and heater element on/off thresholds)
  • Created new DeciCelsiusDelta class for temperature deltas that apply scale factor (9/5) but NOT the +32 offset
  • Heat pump and heater element differential settings now use DeciCelsiusDelta instead of DeciCelsius
  • Added display of heat pump and heater element differential temperature settings in CLI output
  • Updated documentation to reflect unit-agnostic temperature handling

@eman eman requested a review from Copilot January 27, 2026 23:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 fixes incorrect Fahrenheit conversions for temperature delta (differential) settings in heat pump and heater element controls. The changes introduce a new DeciCelsiusDelta class that correctly applies the 9/5 scale factor without the +32 offset (since deltas represent differences, not absolute temperatures), updates the affected model fields to use this new type, and adds these differential settings to the CLI output. Documentation is also updated to reflect unit-agnostic temperature handling.

Changes:

  • Created DeciCelsiusDelta class for temperature delta conversions (scale factor only, no offset)
  • Updated 8 model fields (heat pump and heater element differential settings) to use Div10CelsiusDeltaToPreferred type
  • Enhanced CLI output to display differential temperature settings
  • Updated documentation and examples to use unit-agnostic temperature handling

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/nwp500/temperature.py Added DeciCelsiusDelta class for delta temperature conversions without offset
src/nwp500/models.py Updated differential temperature field types from Div10CelsiusToPreferred to Div10CelsiusDeltaToPreferred
src/nwp500/converters.py Added div_10_celsius_delta_to_preferred converter using DeciCelsiusDelta
src/nwp500/cli/output_formatters.py Added display of 8 differential temperature settings in CLI output
examples/*/*.py Updated temperature display to use get_field_unit() instead of hardcoded "°F"
docs/*.rst Updated documentation to reflect unit-agnostic temperature handling
CHANGELOG.rst Added v7.3.4 release notes

Temperature delta in Fahrenheit.
"""
celsius = self.to_celsius()
return round(celsius * 9 / 5, 1)
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

The to_fahrenheit() method in DeciCelsiusDelta rounds to 1 decimal place, but the parent DeciCelsius.to_fahrenheit() method does not round. Consider removing the round() call for consistency, or explicitly document why delta conversions need rounding while absolute temperature conversions don't.

Suggested change
return round(celsius * 9 / 5, 1)
return celsius * 9 / 5

Copilot uses AI. Check for mistakes.
Address PR review comment: DeciCelsiusDelta.to_fahrenheit() now matches
the parent DeciCelsius.to_fahrenheit() by not applying rounding. This
ensures consistency across temperature conversion methods.
@eman eman merged commit 502e87c into main Jan 27, 2026
7 checks passed
@eman eman deleted the 7.3.4-release branch February 7, 2026 07:14
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.

2 participants