Skip to content

Commit

Permalink
Set refrigerator climate current_temperature to None (issue #801)
Browse files Browse the repository at this point in the history
  • Loading branch information
ollo69 committed Oct 10, 2024
1 parent eba6de2 commit 44f9e7d
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions custom_components/smartthinq_sensors/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,21 +513,16 @@ def temperature_unit(self) -> str:
return UnitOfTemperature.CELSIUS

@property
def current_temperature(self) -> float | None:
"""Return the current temperature."""
curr_temp = self.entity_description.temp_fn(self._wrap_device)
if curr_temp is None:
def target_temperature(self) -> float | None:
"""Return the temperature we try to reach."""
target_temp = self.entity_description.temp_fn(self._wrap_device)
if target_temp is None:
return None
try:
return int(curr_temp)
return int(target_temp)
except ValueError:
return None

@property
def target_temperature(self) -> float | None:
"""Return the temperature we try to reach."""
return self.current_temperature

async def async_set_temperature(self, **kwargs) -> None:
"""Set new target temperature."""
if (new_temp := kwargs.get(ATTR_TEMPERATURE)) is not None:
Expand Down

0 comments on commit 44f9e7d

Please sign in to comment.