Skip to content

Commit

Permalink
Merge pull request #112 from didekoning/temperature_deprication
Browse files Browse the repository at this point in the history
Fix temperature deprication
  • Loading branch information
Olen authored Nov 7, 2023
2 parents 7e384c1 + bd2ad4e commit 1066714
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions custom_components/plant/plant_thresholds.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
)
from homeassistant.helpers.event import async_track_state_change_event
from homeassistant.helpers.restore_state import RestoreEntity
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 @@ -280,7 +280,7 @@ def state_attributes_changed(self, old_attributes, new_attributes):
and new_attributes.get(ATTR_UNIT_OF_MEASUREMENT) == "°C"
):
new_state = round(
convert_temperature(
TemperatureConverter.convert(
temperature=float(self.state),
from_unit=TEMP_FAHRENHEIT,
to_unit=TEMP_CELSIUS,
Expand All @@ -297,7 +297,7 @@ def state_attributes_changed(self, old_attributes, new_attributes):
and new_attributes.get(ATTR_UNIT_OF_MEASUREMENT) == "°F"
):
new_state = round(
convert_temperature(
TemperatureConverter.convert(
temperature=float(self.state),
from_unit=TEMP_CELSIUS,
to_unit=TEMP_FAHRENHEIT,
Expand Down Expand Up @@ -372,7 +372,7 @@ def state_attributes_changed(self, old_attributes, new_attributes):
and new_attributes.get(ATTR_UNIT_OF_MEASUREMENT) == "°C"
):
new_state = round(
convert_temperature(
TemperatureConverter.convert(
temperature=float(self.state),
from_unit=TEMP_FAHRENHEIT,
to_unit=TEMP_CELSIUS,
Expand All @@ -391,7 +391,7 @@ def state_attributes_changed(self, old_attributes, new_attributes):
and new_attributes.get(ATTR_UNIT_OF_MEASUREMENT) == "°F"
):
new_state = round(
convert_temperature(
TemperatureConverter.convert(
temperature=float(self.state),
from_unit=TEMP_CELSIUS,
to_unit=TEMP_FAHRENHEIT,
Expand Down

0 comments on commit 1066714

Please sign in to comment.