Update homeassistant/components/ccm15/coordinator.py

Co-authored-by: Robert Resch <robert@resch.dev>
This commit is contained in:
Oscar Calvo
2023-08-20 12:46:03 -07:00
committed by GitHub
parent 118ff2a656
commit 276c274419

View File

@@ -145,12 +145,11 @@ class CCM15Climate(CoordinatorEntity[CCM15Coordinator], ClimateEntity):
@property
def current_temperature(self) -> Optional[int]:
"""Return current temperature."""
data: Optional[CCM15SlaveDevice] = self.coordinator.get_ac_data(self._ac_index)
if data is None:
return None
_LOGGER.debug("temp[%s]=%s", self._ac_index, data.temperature)
return data.temperature
if data := self.coordinator.get_ac_data(self._ac_index):
_LOGGER.debug("temp[%s]=%s", self._ac_index, data.temperature)
return data.temperature
return None
@property
def target_temperature(self) -> Optional[int]: