Skip to content

Commit

Permalink
fix: rounds percentage
Browse files Browse the repository at this point in the history
Fixes #257
  • Loading branch information
= authored and swingerman committed Aug 6, 2024
1 parent a9e5a47 commit 7e62418
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ def _calculate_power_percent(
# should increase or decrease the power level based on the difference between the current and target temperature
_LOGGER.debug("Calculating hvac power percent")

calculated_power_level = env_difference / power_tolerance
calculated_power_percent = round(env_difference / power_tolerance * 100, 0)

return max(
self._hvac_power_min_percent,
min(
calculated_power_level * 100,
calculated_power_percent,
self._hvac_power_max_percent,
),
)
Expand Down

0 comments on commit 7e62418

Please sign in to comment.