Skip to content

Commit

Permalink
feat: use macro define for fan entity
Browse files Browse the repository at this point in the history
  • Loading branch information
topsworld committed Jan 22, 2025
1 parent 517542a commit 035edcd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions custom_components/xiaomi_home/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.components.fan import FanEntity, FanEntityFeature
from homeassistant.components.fan import (
FanEntity,
FanEntityFeature,
DIRECTION_REVERSE
)
from homeassistant.util.percentage import (
percentage_to_ranged_value,
ranged_value_to_percentage,
Expand Down Expand Up @@ -265,7 +269,7 @@ async def async_set_direction(self, direction: str) -> None:
prop=self._prop_wind_reverse,
value=(
self._prop_wind_reverse_reverse
if self.current_direction == 'reverse'
if self.current_direction == DIRECTION_REVERSE
else self._prop_wind_reverse_forward))

async def async_oscillate(self, oscillating: bool) -> None:
Expand Down

0 comments on commit 035edcd

Please sign in to comment.