From ff0f657dd1b67c27f75d12f3e5d1402a8a9ea00e Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Sun, 19 Dec 2021 18:10:24 +0100 Subject: [PATCH 1/3] Add zhimi.humidifier.ca1 model number --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a6ebcd..18ec54f 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ This custom component is more or less the beta version of the [official componen | Air Dog X5 | airdog.airpurifier.x5 | | | | Air Dog X7SM | airdog.airpurifier.x7sm | | | | Air Humidifier | zhimi.humidifier.v1 | | | -| Air Humidifier CA1 | [zhimi.humidifier.ca1](docs/zhimi.humidifier.ca1.yaml) | | | +| Air Humidifier CA1 | [zhimi.humidifier.ca1](docs/zhimi.humidifier.ca1.yaml) | CJXJSQ02ZM, SKV6001RT | 8W, 240x240x363mm | | Smartmi Humidifier Evaporator 2 | zhimi.humidifier.ca4 | CJXJSQ04ZM | | | Smartmi Evaporative Humidifier | zhimi.humidifier.cb1 | CJXJSQ02ZM, SKV6001EU | 8W, 240x240x363mm | | Mijia Smart Sterilization Humidifier S | deerma.humidifier.mjjsq | MJJSQ03DY | 4.5L, <=39dB, 450mL/h, 40W | From 7c4eaba0e3fcd82371d67cc9556b6467b6a50180 Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Mon, 20 Dec 2021 18:16:04 +0100 Subject: [PATCH 2/3] Add zhimi.humidifier.cb2 support (#242) --- README.md | 1 + custom_components/xiaomi_miio_airpurifier/fan.py | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 18ec54f..94f5ff2 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ This custom component is more or less the beta version of the [official componen | Air Humidifier CA1 | [zhimi.humidifier.ca1](docs/zhimi.humidifier.ca1.yaml) | CJXJSQ02ZM, SKV6001RT | 8W, 240x240x363mm | | Smartmi Humidifier Evaporator 2 | zhimi.humidifier.ca4 | CJXJSQ04ZM | | | Smartmi Evaporative Humidifier | zhimi.humidifier.cb1 | CJXJSQ02ZM, SKV6001EU | 8W, 240x240x363mm | +| Smartmi Evaporative Humidifier (Korea Version) | zhimi.humidifier.cb2 | CJXJSQ02ZM | 8W, 240x240x363mm | | Mijia Smart Sterilization Humidifier S | deerma.humidifier.mjjsq | MJJSQ03DY | 4.5L, <=39dB, 450mL/h, 40W | | Mijia Intelligent Sterilization Humidifier (EU version?) | deerma.humidifier.jsq | ZNJSQ01DEM | 4.5L, <=38dB, 300mL/h, 24W | | Mijia Intelligent Sterilization Humidifier (EU version?) | deerma.humidifier.jsq5 | ZNJSQ01DEM | 4.5L, <=38dB, 300mL/h, 24W | diff --git a/custom_components/xiaomi_miio_airpurifier/fan.py b/custom_components/xiaomi_miio_airpurifier/fan.py index 4a84b9b..a3297aa 100644 --- a/custom_components/xiaomi_miio_airpurifier/fan.py +++ b/custom_components/xiaomi_miio_airpurifier/fan.py @@ -134,6 +134,7 @@ MODEL_AIRHUMIDIFIER_CA1 = "zhimi.humidifier.ca1" MODEL_AIRHUMIDIFIER_CA4 = "zhimi.humidifier.ca4" MODEL_AIRHUMIDIFIER_CB1 = "zhimi.humidifier.cb1" +MODEL_AIRHUMIDIFIER_CB2 = "zhimi.humidifier.cb2" MODEL_AIRHUMIDIFIER_MJJSQ = "deerma.humidifier.mjjsq" MODEL_AIRHUMIDIFIER_JSQ = "deerma.humidifier.jsq" MODEL_AIRHUMIDIFIER_JSQ1 = "deerma.humidifier.jsq1" @@ -190,6 +191,7 @@ MODEL_AIRHUMIDIFIER_CA1, MODEL_AIRHUMIDIFIER_CA4, MODEL_AIRHUMIDIFIER_CB1, + MODEL_AIRHUMIDIFIER_CB2, MODEL_AIRHUMIDIFIER_MJJSQ, MODEL_AIRHUMIDIFIER_JSQ, MODEL_AIRHUMIDIFIER_JSQ1, @@ -549,7 +551,11 @@ ATTR_EXTRA_FEATURES: "extra_features", } -AVAILABLE_ATTRIBUTES_AIRFRESH_VA4 = {**AVAILABLE_ATTRIBUTES_AIRFRESH, ATTR_PTC: "ptc", ATTR_NTC_TEMPERATURE: "ntc_temperature"} +AVAILABLE_ATTRIBUTES_AIRFRESH_VA4 = { + **AVAILABLE_ATTRIBUTES_AIRFRESH, + ATTR_PTC: "ptc", + ATTR_NTC_TEMPERATURE: "ntc_temperature", +} AVAILABLE_ATTRIBUTES_AIRFRESH_A1 = { ATTR_POWER: "power", @@ -1637,7 +1643,11 @@ def __init__(self, name, device, model, unique_id): """Initialize the plug switch.""" super().__init__(name, device, model, unique_id) - if self._model in [MODEL_AIRHUMIDIFIER_CA1, MODEL_AIRHUMIDIFIER_CB1]: + if self._model in [ + MODEL_AIRHUMIDIFIER_CA1, + MODEL_AIRHUMIDIFIER_CB1, + MODEL_AIRHUMIDIFIER_CB2, + ]: self._device_features = FEATURE_FLAGS_AIRHUMIDIFIER_CA_AND_CB self._available_attributes = AVAILABLE_ATTRIBUTES_AIRHUMIDIFIER_CA_AND_CB self._preset_modes = [ From 7e1ad17cd4b3d261986a2d543e8e1fbcb1f03031 Mon Sep 17 00:00:00 2001 From: deese Date: Thu, 3 Mar 2022 14:11:11 +0100 Subject: [PATCH 3/3] Fix imports to be python-miio v0.5.10 compatible (#256) Closes: #253 --- custom_components/xiaomi_miio_airpurifier/fan.py | 9 ++++----- custom_components/xiaomi_miio_airpurifier/manifest.json | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/custom_components/xiaomi_miio_airpurifier/fan.py b/custom_components/xiaomi_miio_airpurifier/fan.py index a3297aa..d6fdf87 100644 --- a/custom_components/xiaomi_miio_airpurifier/fan.py +++ b/custom_components/xiaomi_miio_airpurifier/fan.py @@ -64,15 +64,14 @@ LedBrightness as AirpurifierMiotLedBrightness, OperationMode as AirpurifierMiotOperationMode, ) -from miio.fan import ( # pylint: disable=import-error, import-error +from miio.fan_common import ( # pylint: disable=import-error, import-error LedBrightness as FanLedBrightness, MoveDirection as FanMoveDirection, OperationMode as FanOperationMode, ) -from miio.fan_leshow import ( # pylint: disable=import-error, import-error +from miio.integrations.fan.leshow.fan_leshow import ( # pylint: disable=import-error, import-error OperationMode as FanLeshowOperationMode, ) -from miio.fan_miot import OperationModeMiot as FanOperationModeMiot import voluptuous as vol from homeassistant.components.fan import ( @@ -2914,7 +2913,7 @@ async def async_set_natural_mode_on(self): await self._try_command( "Setting fan natural mode of the miio device failed.", self._device.set_mode, - FanOperationModeMiot.Nature, + FanOperationMode.Nature, ) async def async_set_natural_mode_off(self): @@ -2925,7 +2924,7 @@ async def async_set_natural_mode_off(self): await self._try_command( "Setting fan natural mode of the miio device failed.", self._device.set_mode, - FanOperationModeMiot.Normal, + FanOperationMode.Normal, ) diff --git a/custom_components/xiaomi_miio_airpurifier/manifest.json b/custom_components/xiaomi_miio_airpurifier/manifest.json index 3b80666..e2b195e 100644 --- a/custom_components/xiaomi_miio_airpurifier/manifest.json +++ b/custom_components/xiaomi_miio_airpurifier/manifest.json @@ -1,14 +1,14 @@ { "domain": "xiaomi_miio_airpurifier", "name": "Xiaomi Mi Air Purifier, Air Humidifier, Air Fresh and Pedestal Fan Integration", - "version": "0.6.17", + "version": "2022.3.0", "iot_class": "local_polling", "config_flow": false, "documentation": "https://github.com/syssi/xiaomi_airpurifier", "issue_tracker": "https://github.com/syssi/xiaomi_airpurifier/issues", "requirements": [ "construct==2.10.56", - "python-miio>=0.5.9.2" + "python-miio>=0.5.10" ], "dependencies": [], "codeowners": [