This fixes a bug that was introduced when handling heat-only and cool-only thermostats that caused thermostats supporting both to render incorrect temperatures within the slider. This occurs because of a short-circuit that exists when checking for support for heat_cool which caused them to always be treated as being in heat_cool mode.
This fix now properly checks for heat-only or cool-only support in addition to the thermostats being in the relevant heat or cool state to render those specific cases. For all other cases (auto or heat_cool mode in a thermostat that supports both, or supports target ranges), we default back to the previous logic of using the target ranges to render both sliders. This no longer requires us to check for target range support since it is normally required in heat_cool and auto mode on thermostats that support both heating and cooling.
Related Issue
Fixes bug introduced in #20 when fixing #19.
Motivation and Context
How Has This Been Tested
Tested locally on thermostats which support both heat/cool as well as cool-only thermostats to ensure it renders correctly.
Types of changes
[x] ๐ Bug fix (non-breaking change which fixes an issue)
[ ] ๐ New feature (non-breaking change which adds functionality)
[ ] ๐ Translation (addition or update a translation)
[ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
Checklist
[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
Description
This fixes a bug that was introduced when handling heat-only and cool-only thermostats that caused thermostats supporting both to render incorrect temperatures within the slider. This occurs because of a short-circuit that exists when checking for support for heat_cool which caused them to always be treated as being in heat_cool mode.
This fix now properly checks for heat-only or cool-only support in addition to the thermostats being in the relevant heat or cool state to render those specific cases. For all other cases (auto or heat_cool mode in a thermostat that supports both, or supports target ranges), we default back to the previous logic of using the target ranges to render both sliders. This no longer requires us to check for target range support since it is normally required in heat_cool and auto mode on thermostats that support both heating and cooling.
Related Issue
Fixes bug introduced in #20 when fixing #19.
Motivation and Context
How Has This Been Tested
Tested locally on thermostats which support both heat/cool as well as cool-only thermostats to ensure it renders correctly.
Types of changes
Checklist