From 0024b79f25db49d5cbdc89e64aaa0dffb4c15deb Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Sat, 18 Dec 2021 21:26:57 +0100 Subject: [PATCH 1/3] zhimi.humidifier.cb1: Add water_level attribute --- custom_components/xiaomi_miio_airpurifier/fan.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/custom_components/xiaomi_miio_airpurifier/fan.py b/custom_components/xiaomi_miio_airpurifier/fan.py index d476c04..6080bf7 100644 --- a/custom_components/xiaomi_miio_airpurifier/fan.py +++ b/custom_components/xiaomi_miio_airpurifier/fan.py @@ -479,12 +479,14 @@ **AVAILABLE_ATTRIBUTES_AIRHUMIDIFIER_COMMON, ATTR_TARGET_HUMIDITY: "target_humidity", ATTR_MOTOR_SPEED: "motor_speed", - ATTR_DEPTH: "depth", + ATTR_DEPTH: "depth", # deprecated ATTR_DRY: "dry", ATTR_CHILD_LOCK: "child_lock", ATTR_LED_BRIGHTNESS: "led_brightness", ATTR_USE_TIME: "use_time", ATTR_HARDWARE_VERSION: "hardware_version", + ATTR_WATER_LEVEL: "water_level", + ATTR_WATER_TANK_DETACHED: "water_tank_detached", } AVAILABLE_ATTRIBUTES_AIRHUMIDIFIER_CA4 = { @@ -516,9 +518,7 @@ ATTR_WET_PROTECTION: "wet_protection", } -AVAILABLE_ATTRIBUTES_AIRHUMIDIFIER_JSQ5 = { - **AVAILABLE_ATTRIBUTES_AIRHUMIDIFIER_MJJSQ -} +AVAILABLE_ATTRIBUTES_AIRHUMIDIFIER_JSQ5 = {**AVAILABLE_ATTRIBUTES_AIRHUMIDIFIER_MJJSQ} AVAILABLE_ATTRIBUTES_AIRHUMIDIFIER_JSQ = { **AVAILABLE_ATTRIBUTES_AIRHUMIDIFIER_COMMON, @@ -816,9 +816,7 @@ ) FEATURE_FLAGS_AIRHUMIDIFIER_JSQ5 = ( - FEATURE_SET_BUZZER - | FEATURE_SET_LED - | FEATURE_SET_TARGET_HUMIDITY + FEATURE_SET_BUZZER | FEATURE_SET_LED | FEATURE_SET_TARGET_HUMIDITY ) FEATURE_FLAGS_AIRHUMIDIFIER_JSQ = ( @@ -1115,7 +1113,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= MODEL_AIRHUMIDIFIER_MJJSQ, MODEL_AIRHUMIDIFIER_JSQ, MODEL_AIRHUMIDIFIER_JSQ1, - MODEL_AIRHUMIDIFIER_JSQ5 + MODEL_AIRHUMIDIFIER_JSQ5, ]: air_humidifier = AirHumidifierMjjsq(host, token, model=model) device = XiaomiAirHumidifierMjjsq(name, air_humidifier, model, unique_id) From 4f37cc7478e6c6479adde4a866a3639ecb36f0c7 Mon Sep 17 00:00:00 2001 From: mr G1K Date: Sat, 18 Dec 2021 23:33:18 +0300 Subject: [PATCH 2/3] Add ntc_temperature support of the zhimi.airfresh.va4 (#218) --- README.md | 1 + custom_components/xiaomi_miio_airpurifier/fan.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 936d8ff..4a6ebcd 100644 --- a/README.md +++ b/README.md @@ -451,6 +451,7 @@ This model uses newer MiOT communication protocol. - `motor_speed` - `extra_features` - `ptc` (zhimi.airfresh.va4 only) + - `ntc_temperature` (zhimi.airfresh.va4 only) ### Mi Fresh Air Ventilator (dmaker.airfresh.t2017, dmaker.airfresh.a1) diff --git a/custom_components/xiaomi_miio_airpurifier/fan.py b/custom_components/xiaomi_miio_airpurifier/fan.py index 6080bf7..4a84b9b 100644 --- a/custom_components/xiaomi_miio_airpurifier/fan.py +++ b/custom_components/xiaomi_miio_airpurifier/fan.py @@ -284,6 +284,8 @@ ATTR_CO2 = "co2" ATTR_PTC = "ptc" +ATTR_NTC_TEMPERATURE = "ntc_temperature" + # Air Fresh T2017 ATTR_POWER = "power" ATTR_PM25 = "pm25" @@ -547,7 +549,7 @@ ATTR_EXTRA_FEATURES: "extra_features", } -AVAILABLE_ATTRIBUTES_AIRFRESH_VA4 = {**AVAILABLE_ATTRIBUTES_AIRFRESH, ATTR_PTC: "ptc"} +AVAILABLE_ATTRIBUTES_AIRFRESH_VA4 = {**AVAILABLE_ATTRIBUTES_AIRFRESH, ATTR_PTC: "ptc", ATTR_NTC_TEMPERATURE: "ntc_temperature"} AVAILABLE_ATTRIBUTES_AIRFRESH_A1 = { ATTR_POWER: "power", From 6bfcfd496230412024f3c5431db9cad58784c476 Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Sun, 19 Dec 2021 08:34:07 +0100 Subject: [PATCH 3/3] Bump component version --- custom_components/xiaomi_miio_airpurifier/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/xiaomi_miio_airpurifier/manifest.json b/custom_components/xiaomi_miio_airpurifier/manifest.json index 0c34020..3b80666 100644 --- a/custom_components/xiaomi_miio_airpurifier/manifest.json +++ b/custom_components/xiaomi_miio_airpurifier/manifest.json @@ -1,7 +1,7 @@ { "domain": "xiaomi_miio_airpurifier", "name": "Xiaomi Mi Air Purifier, Air Humidifier, Air Fresh and Pedestal Fan Integration", - "version": "0.6.16", + "version": "0.6.17", "iot_class": "local_polling", "config_flow": false, "documentation": "https://github.com/syssi/xiaomi_airpurifier",