Fix setting temperature in 8000 Celsius on radiotherm CT50 #4270
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.
Description:
There seem to be a bug in Radiotherm CT50 thermostat, when setting temperature that is not an integer or ending ".5", it does not do anything (and still return success). CT50 API always expects temperature in Fahrenheit. If home assistant is set to use metric units (and Celsius degrees), it converts temperature before sending to the thermostat. But resulting temperature in Fahrenheit might not be an integer or ending ".5". As a result, only certain Celsius temperatures can be set, such as 20C (=68F) or 25C (=77F), but not 22C (=71.6F) for example. The proposed fix rounds temperature to the nearest 0.5 before sending to CT50, so it works for any Celsius temperature.
Related issue (if applicable): fixes #
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>
Example entry for
configuration.yaml
(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass