Skip to content

Commit

Permalink
chore: allign
Browse files Browse the repository at this point in the history
  • Loading branch information
chemelli74 committed Dec 17, 2024
1 parent 68a80a7 commit 7681c39
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
9 changes: 6 additions & 3 deletions custom_components/midea_ac_lan/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ def current_humidity(self) -> float | None:
def outdoor_temperature(self) -> float:
"""Midea AC Climate outdoor temperature."""
return cast(
"float", self._device.get_attribute(ACAttributes.outdoor_temperature)
"float",
self._device.get_attribute(ACAttributes.outdoor_temperature),
)

def set_fan_mode(self, fan_mode: str) -> None:
Expand Down Expand Up @@ -452,7 +453,8 @@ def target_temperature_high(self) -> float:
def current_temperature(self) -> float:
"""Midea CF Climate current temperature."""
return cast(
"float", self._device.get_attribute(CFAttributes.current_temperature)
"float",
self._device.get_attribute(CFAttributes.current_temperature),
)


Expand Down Expand Up @@ -649,7 +651,8 @@ def hvac_mode(self) -> HVACMode:
def current_temperature(self) -> float:
"""Midea FB Climate current temperature."""
return cast(
"float", self._device.get_attribute(FBAttributes.current_temperature)
"float",
self._device.get_attribute(FBAttributes.current_temperature),
)

def set_temperature(self, **kwargs: Any) -> None: # noqa: ANN401
Expand Down
2 changes: 1 addition & 1 deletion custom_components/midea_ac_lan/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def percentage(self) -> int | None:
"""Midea Fan percentage."""
if not self.fan_speed:
return None
return int(round(self.fan_speed * self.percentage_step))
return round(self.fan_speed * self.percentage_step)

def set_percentage(self, percentage: int) -> None:
"""Midea Fan set percentage."""
Expand Down
3 changes: 2 additions & 1 deletion custom_components/midea_ac_lan/midea_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def __init__(self, device: MideaDevice, entity_key: str) -> None:
self._device = device
self._device.register_update(self.update_state)
self._config = cast(
"dict", MIDEA_DEVICES[self._device.device_type]["entities"]
"dict",
MIDEA_DEVICES[self._device.device_type]["entities"],
)[entity_key]
self._entity_key = entity_key
self._unique_id = f"{DOMAIN}.{self._device.device_id}_{entity_key}"
Expand Down

0 comments on commit 7681c39

Please sign in to comment.