Skip to content

Commit

Permalink
Update plant_thresholds.py
Browse files Browse the repository at this point in the history
fix #122, #124
  • Loading branch information
ChristophCaina authored Dec 31, 2023
1 parent d66fe62 commit 8662979
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions custom_components/plant/plant_thresholds.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
LIGHT_LUX,
PERCENTAGE,
STATE_UNKNOWN,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
UnitOfTemperature,
)
from homeassistant.core import Event, HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
Expand Down Expand Up @@ -282,8 +281,8 @@ def state_attributes_changed(self, old_attributes, new_attributes):
new_state = round(
TemperatureConverter.convert(
temperature=float(self.state),
from_unit=TEMP_FAHRENHEIT,
to_unit=TEMP_CELSIUS,
from_unit=UnitOfTemperature.FAHRENHEIT,
to_unit=UnitOfTemperature.CELSIUS,
)
)
_LOGGER.debug(
Expand All @@ -299,8 +298,8 @@ def state_attributes_changed(self, old_attributes, new_attributes):
new_state = round(
TemperatureConverter.convert(
temperature=float(self.state),
from_unit=TEMP_CELSIUS,
to_unit=TEMP_FAHRENHEIT,
from_unit=UnitOfTemperature.CELSIUS,
to_unit=UnitOfTemperature.FAHRENHEIT,
)
)
_LOGGER.debug(
Expand Down Expand Up @@ -374,8 +373,8 @@ def state_attributes_changed(self, old_attributes, new_attributes):
new_state = round(
TemperatureConverter.convert(
temperature=float(self.state),
from_unit=TEMP_FAHRENHEIT,
to_unit=TEMP_CELSIUS,
from_unit=UnitOfTemperature.FAHRENHEIT,
to_unit=UnitOfTemperature.CELSIUS,
)
)
_LOGGER.debug(
Expand All @@ -393,8 +392,8 @@ def state_attributes_changed(self, old_attributes, new_attributes):
new_state = round(
TemperatureConverter.convert(
temperature=float(self.state),
from_unit=TEMP_CELSIUS,
to_unit=TEMP_FAHRENHEIT,
from_unit=UnitOfTemperature.CELSIUS,
to_unit=UnitOfTemperature.FAHRENHEIT,
)
)
_LOGGER.debug(
Expand Down

0 comments on commit 8662979

Please sign in to comment.