Skip to content

Commit

Permalink
Merge branch 'release/2022.4.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Apr 6, 2022
2 parents 51a9ecd + 66ff238 commit 1a7a744
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
28 changes: 15 additions & 13 deletions custom_components/xiaomi_miio_fan/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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__)

Expand Down Expand Up @@ -113,6 +112,8 @@
}
)

SPEED_OFF = "off"

ATTR_MODEL = "model"
ATTR_BRIGHTNESS = "brightness"

Expand Down Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion custom_components/xiaomi_miio_fan/manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 1a7a744

Please sign in to comment.