diff --git a/README.md b/README.md index b792130..4f0176f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This is a custom component for home assistant to integrate the Xiaomi Mi Smart Fan. -Please follow the instructions on [Retrieving the Access Token](https://www.home-assistant.io/integrations/xiaomi_miio#retrieving-the-access-token) to get the API token to use in the configuration.yaml file. +Please follow the instructions on [Retrieving the Access Token](https://www.home-assistant.io/integrations/xiaomi_miio/#xiaomi-cloud-tokens-extractor) to get the API token to use in the configuration.yaml file. Credits: Thanks to [Rytilahti](https://github.com/rytilahti/python-miio) for all the work. diff --git a/custom_components/xiaomi_miio_fan/fan.py b/custom_components/xiaomi_miio_fan/fan.py index aed02f9..5d11285 100644 --- a/custom_components/xiaomi_miio_fan/fan.py +++ b/custom_components/xiaomi_miio_fan/fan.py @@ -8,13 +8,12 @@ import logging from enum import Enum from functools import partial -from typing import Optional, Dict, Any +from typing import Any, Dict, Optional import homeassistant.helpers.config_validation as cv import voluptuous as vol from homeassistant.components.fan import ( PLATFORM_SCHEMA, - SPEED_OFF, SUPPORT_DIRECTION, SUPPORT_OSCILLATE, SUPPORT_PRESET_MODE, @@ -33,25 +32,25 @@ ordered_list_item_to_percentage, percentage_to_ordered_list_item, ) -from miio import ( # pylint: disable=import-error +from miio import ( Device, DeviceException, - Fan, + Fan, # pylint: disable=import-error Fan1C, FanLeshow, + FanMiot, FanP5, - FanMiot ) -from miio.miot_device import MiotDevice, DeviceStatus +from miio.fan_common import FanException from miio.fan_common import ( - LedBrightness as FanLedBrightness, # pylint: disable=import-error, import-error - MoveDirection as FanMoveDirection, - OperationMode as FanOperationMode, - FanException, -) + LedBrightness as FanLedBrightness, +) # pylint: disable=import-error, import-error +from miio.fan_common import MoveDirection as FanMoveDirection +from miio.fan_common import OperationMode as FanOperationMode from miio.integrations.fan.leshow.fan_leshow import ( - OperationMode as FanLeshowOperationMode, # pylint: disable=import-error, import-error -) + OperationMode as FanLeshowOperationMode, +) # pylint: disable=import-error, import-error +from miio.miot_device import DeviceStatus, MiotDevice _LOGGER = logging.getLogger(__name__) @@ -113,6 +112,8 @@ } ) +SPEED_OFF = "off" + ATTR_MODEL = "model" ATTR_BRIGHTNESS = "brightness" @@ -997,6 +998,7 @@ async def async_set_delay_off(self, delay_off_countdown: int) -> None: class XiaomiFanMiot(XiaomiFanP5): """Representation of a Xiaomi Pedestal Fan P9, P10, P11, P18.""" + pass diff --git a/custom_components/xiaomi_miio_fan/manifest.json b/custom_components/xiaomi_miio_fan/manifest.json index 67a3b80..bb01bfc 100644 --- a/custom_components/xiaomi_miio_fan/manifest.json +++ b/custom_components/xiaomi_miio_fan/manifest.json @@ -1,7 +1,7 @@ { "domain": "xiaomi_miio_fan", "name": "Xiaomi Mi Smart Pedestal Fan", - "version": "2022.3.3.1", + "version": "2022.4.0.0", "iot_class": "local_polling", "documentation": "https://github.com/syssi/xiaomi_fan", "issue_tracker": "https://github.com/syssi/xiaomi_fan/issues",