Skip to content

Commit

Permalink
fix: revert some changes from georgezhao2010#53
Browse files Browse the repository at this point in the history
  • Loading branch information
Necroneco committed Jun 2, 2024
1 parent 3f904b3 commit 93292d9
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions custom_components/midea_ac_lan/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ def target_temperature(self) -> float:
return cast(float, self._device.get_attribute("target_temperature"))

@property
def current_temperature(self) -> float:
return cast(float, self._device.get_attribute("indoor_temperature"))
def current_temperature(self) -> float | None:
return cast(float | None, self._device.get_attribute("indoor_temperature"))

@property
def preset_modes(self) -> list[str]:
Expand Down Expand Up @@ -417,15 +417,16 @@ def current_temperature(self) -> float:


class MideaC3Climate(MideaClimate):
def __init__(self, device: Any, entity_key: str, zone: str) -> None:
_powers = [
C3Attributes.zone1_power,
C3Attributes.zone2_power,
]

def __init__(self, device: Any, entity_key: str, zone: int) -> None:
super().__init__(device, entity_key)
self._zone = zone
self._modes = [HVACMode.OFF, HVACMode.AUTO, HVACMode.COOL, HVACMode.HEAT]
self._power_attr = (
C3Attributes.zone1_power
if zone == "zone1_power"
else C3Attributes.zone2_power
)
self._power_attr = MideaC3Climate._powers[zone]

@property
def supported_features(self) -> ClimateEntityFeature:
Expand Down Expand Up @@ -489,8 +490,8 @@ def target_temperature(self) -> float:
)

@property
def current_temperature(self) -> float:
return 0
def current_temperature(self) -> float | None:
return None

def set_temperature(self, **kwargs: Any) -> None:
if ATTR_TEMPERATURE not in kwargs:
Expand Down

0 comments on commit 93292d9

Please sign in to comment.