Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix fan stepless speed control not working #418

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions custom_components/xiaomi_miot_raw/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ def preset_mode(self):
"""Return the current speed."""
return self._mode

# @property
# def percentage(self):
# return None
@property
def percentage(self):
return self.speed

@property
def speed_count(self):
Expand Down Expand Up @@ -226,9 +226,9 @@ async def async_set_direction(self, direction: str) -> None:
raise TypeError(f"Your fan does not support {direction}.")
await self.set_property_new(self._did_prefix + "motor_control", self._ctrl_params['motor_control'][d])

# async def async_set_percentage(self, percentage: int) -> None:
# """Set the speed percentage of the fan."""
# pass
async def async_set_percentage(self, percentage: int) -> None:
"""Set the speed percentage of the fan."""
await self.async_set_speed(percentage)

def _handle_platform_specific_attrs(self):
super()._handle_platform_specific_attrs()
Expand Down