Skip to content

Commit

Permalink
Merge pull request #1 from lafriks/patch-1
Browse files Browse the repository at this point in the history
Fix temperature conversion to use new util class
  • Loading branch information
robvanoostenrijk committed Jan 15, 2024
2 parents 7b59d66 + b43d480 commit 26a3f70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/iaquk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import async_track_state_change
from homeassistant.util.temperature import convert as convert_temperature
from homeassistant.util.unit_conversion import TemperatureConverter

from .const import (
ATTR_SOURCE_INDEX_TPL,
Expand Down Expand Up @@ -369,7 +369,7 @@ def _temperature_index(self) -> Optional[int]:
)

if entity_unit != TEMP_CELSIUS:
value = convert_temperature(value, entity_unit, TEMP_CELSIUS)
value = TemperatureConverter.convert(value, entity_unit, TEMP_CELSIUS)

index = 1
if 18 <= value <= 21: # °C
Expand Down

0 comments on commit 26a3f70

Please sign in to comment.