Skip to content

Commit

Permalink
Fix temperature conversion deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 authored Oct 25, 2023
1 parent 7710d76 commit ed66d3c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions custom_components/plant/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
)
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.event import async_track_state_change_event
from homeassistant.util.temperature import convert as convert_temperature
from homeassistant.util.unit_conversion import TemperatureConverter

from .const import (
ATTR_CONDUCTIVITY,
Expand Down Expand Up @@ -350,7 +350,7 @@ def state_attributes_changed(self, old_attributes, new_attributes):
and new_attributes.get(ATTR_UNIT_OF_MEASUREMENT) == "°C"
):
new_state = round(
convert_temperature(
TemperatureConerter.convert(
temperature=float(self.state),
from_unit=TEMP_FAHRENHEIT,
to_unit=TEMP_CELSIUS,
Expand All @@ -367,7 +367,7 @@ def state_attributes_changed(self, old_attributes, new_attributes):
and new_attributes.get(ATTR_UNIT_OF_MEASUREMENT) == "°F"
):
new_state = round(
convert_temperature(
TemperatureConerter.convert(
temperature=float(self.state),
from_unit=TEMP_CELSIUS,
to_unit=TEMP_FAHRENHEIT,
Expand Down Expand Up @@ -422,7 +422,7 @@ def state_attributes_changed(self, old_attributes, new_attributes):
and new_attributes.get(ATTR_UNIT_OF_MEASUREMENT) == "°C"
):
new_state = round(
convert_temperature(
TemperatureConerter.convert(
temperature=float(self.state),
from_unit=TEMP_FAHRENHEIT,
to_unit=TEMP_CELSIUS,
Expand All @@ -441,7 +441,7 @@ def state_attributes_changed(self, old_attributes, new_attributes):
and new_attributes.get(ATTR_UNIT_OF_MEASUREMENT) == "°F"
):
new_state = round(
convert_temperature(
TemperatureConerter.convert(
temperature=float(self.state),
from_unit=TEMP_CELSIUS,
to_unit=TEMP_FAHRENHEIT,
Expand Down

0 comments on commit ed66d3c

Please sign in to comment.