docs: correct temperature conversion documentation#44
Merged
Conversation
The documentation incorrectly stated that temperature values use a simple +20 offset (e.g., raw + 20). The actual encoding is half-degrees Celsius. Correct formula: fahrenheit = (raw_value / 2.0) * 9/5 + 32 Updated files: - docs/guides/reservations.rst - docs/guides/scheduling_features.rst - docs/guides/advanced_features_explained.rst - docs/protocol/device_features.rst - docs/protocol/firmware_tracking.rst - docs/protocol/mqtt_protocol.rst - docs/python_api/constants.rst - src/nwp500/models.py (comment fix)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR corrects widespread documentation errors regarding temperature encoding in the NWP500 protocol. The documentation incorrectly stated that temperatures use a simple +20 offset, when they actually use half-degrees Celsius encoding with the formula fahrenheit = (raw_value / 2.0) * 9/5 + 32.
Key changes:
- Replaced all
raw + 20references with properHalfCelsiusToFconversion formula - Updated temperature examples across all documentation files (e.g., 120°F is
param=98, notparam=100) - Fixed code comment in
models.pyto accurately describe the encoding scheme
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/nwp500/models.py | Corrected misleading comment from "offset (raw + 20)" to "encoded in half-degrees Celsius" |
| docs/python_api/constants.rst | Changed conversion field from "raw + 20" to "HalfCelsiusToF" |
| docs/protocol/mqtt_protocol.rst | Updated temperature encoding documentation with correct formula and examples |
| docs/protocol/firmware_tracking.rst | Replaced raw + 20 conversion references with HalfCelsiusToF |
| docs/protocol/device_features.rst | Updated conversion column entries and added formula reference |
| docs/guides/scheduling_features.rst | Fixed temperature parameter encoding section with correct formulas and examples |
| docs/guides/reservations.rst | Comprehensively updated all temperature-related documentation and code examples |
| docs/guides/advanced_features_explained.rst | Replaced "Formula Confirmation" section with detailed temperature conversion reference |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The documentation incorrectly stated that temperature values use a simple
+20offset (e.g.,raw + 20,param + 20). The actual encoding is half-degrees Celsius.What was wrong
Documentation claimed:
displayed_value = raw_value + 20param=100for 120°F (implying 100 + 20 = 120)What is correct
Temperature values are encoded in half-degrees Celsius:
fahrenheit = (raw_value / 2.0) * 9/5 + 32param = (fahrenheit - 32) * 5/9 * 2Examples:
Files Updated
docs/guides/reservations.rst- Updated temperature parameter documentation and code examplesdocs/guides/scheduling_features.rst- Fixed temperature encoding documentationdocs/guides/advanced_features_explained.rst- Replaced "Formula Confirmation" section with correct conversion referencedocs/protocol/device_features.rst- Updated conversion column referencesdocs/protocol/firmware_tracking.rst- Updated conversion examplesdocs/protocol/mqtt_protocol.rst- Fixed temperature encoding notesdocs/python_api/constants.rst- Updated example conversionsrc/nwp500/models.py- Fixed misleading commentValidation