From 00f61c061f1166dd592a8d7c49d024345b493d14 Mon Sep 17 00:00:00 2001 From: kei81131 <111072203+kei81131@users.noreply.github.com> Date: Tue, 13 Aug 2024 15:34:36 +0800 Subject: [PATCH 1/2] improve for zhimi.fan.fb1 --- .../xiaomi_miot/core/device_customizes.py | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/custom_components/xiaomi_miot/core/device_customizes.py b/custom_components/xiaomi_miot/core/device_customizes.py index ec3f41ff1..ba0765063 100644 --- a/custom_components/xiaomi_miot/core/device_customizes.py +++ b/custom_components/xiaomi_miot/core/device_customizes.py @@ -1709,6 +1709,47 @@ 'switch_properties': 'anion,alarm,horizontal_swing,vertical_swing', 'number_properties': 'horizontal_angle,vertical_angle,off_delay', }, + 'zhimi.fan.fb1': { + 'extend_miot_specs': [ + { + 'iid': 2, + 'properties': [ + { + 'iid': 5, + 'value-range': [30, 120, 30] + }, + { + 'iid': 6, + 'value-range': [30, 90, 30] + } + ] + }, + { + 'iid': 5, + 'properties': [ + { + 'iid': 6, + 'value-list': [ + {'value': 'left', 'description': 'LEFT'}, + {'value': 'right', 'description': 'RIGHT'} + ] + }, + { + 'iid': 7, + 'value-list': [ + {'value': 'up', 'description': 'UP'}, + {'value': 'down', 'description': 'DOWN'} + ] + } + ] + } + ], + 'switch_properties': 'alarm,horizontal_swing,vertical_swing,oscillating,h_swing_back,v_swing_back', + 'number_properties': 'timing', + 'percentage_property': 'stepless_fan_level', + 'select_properties': 'mode,horizontal_angle,vertical_angle', + 'button_properties': 'h_swing_step_move,v_swing_step_move' + }, 'zhimi.heater.na1': { 'switch_properties': 'return_to_middle,alarm', 'number_properties': 'countdown_time', From 567a5f4be110e2aedfbd02092c4cc506442a4eb1 Mon Sep 17 00:00:00 2001 From: Alone Date: Fri, 16 Aug 2024 11:46:57 +0800 Subject: [PATCH 2/2] Update device_customizes.py --- .../xiaomi_miot/core/device_customizes.py | 74 +++++++++---------- 1 file changed, 34 insertions(+), 40 deletions(-) diff --git a/custom_components/xiaomi_miot/core/device_customizes.py b/custom_components/xiaomi_miot/core/device_customizes.py index ba0765063..44d9bed62 100644 --- a/custom_components/xiaomi_miot/core/device_customizes.py +++ b/custom_components/xiaomi_miot/core/device_customizes.py @@ -1697,52 +1697,34 @@ 'brightness_for_on': 0, 'brightness_for_off': 2, }, - 'zhimi.fan.za3': { - 'miot_type': 'urn:miot-spec-v2:device:fan:0000A005:zhimi-za3:3', - 'number_select_properties': 'fan_level', - }, - 'zhimi.fan.za4': { - 'miot_type': 'urn:miot-spec-v2:device:fan:0000A005:zhimi-za4:3', - 'number_select_properties': 'fan_level', - }, - 'zhimi.fan.*': { - 'switch_properties': 'anion,alarm,horizontal_swing,vertical_swing', - 'number_properties': 'horizontal_angle,vertical_angle,off_delay', - }, 'zhimi.fan.fb1': { 'extend_miot_specs': [ - { - 'iid': 2, - 'properties': [ { - 'iid': 5, - 'value-range': [30, 120, 30] + 'iid': 2, + 'properties': [ + {'iid': 5, 'value-range': [30, 120, 30]}, + {'iid': 6, 'value-range': [30, 90, 30]}, + ], }, { - 'iid': 6, - 'value-range': [30, 90, 30] - } - ] - }, - { - 'iid': 5, - 'properties': [ - { - 'iid': 6, - 'value-list': [ - {'value': 'left', 'description': 'LEFT'}, - {'value': 'right', 'description': 'RIGHT'} - ] + 'iid': 5, + 'properties': [ + { + 'iid': 6, + 'value-list': [ + {'value': 'left', 'description': 'Turn Left'}, + {'value': 'right', 'description': 'Turn Right'}, + ], + }, + { + 'iid': 7, + 'value-list': [ + {'value': 'up', 'description': 'Turn Up'}, + {'value': 'down', 'description': 'Turn Down'}, + ], + }, + ], }, - { - 'iid': 7, - 'value-list': [ - {'value': 'up', 'description': 'UP'}, - {'value': 'down', 'description': 'DOWN'} - ] - } - ] - } ], 'switch_properties': 'alarm,horizontal_swing,vertical_swing,oscillating,h_swing_back,v_swing_back', 'number_properties': 'timing', @@ -1750,6 +1732,18 @@ 'select_properties': 'mode,horizontal_angle,vertical_angle', 'button_properties': 'h_swing_step_move,v_swing_step_move' }, + 'zhimi.fan.za3': { + 'miot_type': 'urn:miot-spec-v2:device:fan:0000A005:zhimi-za3:3', + 'number_select_properties': 'fan_level', + }, + 'zhimi.fan.za4': { + 'miot_type': 'urn:miot-spec-v2:device:fan:0000A005:zhimi-za4:3', + 'number_select_properties': 'fan_level', + }, + 'zhimi.fan.*': { + 'switch_properties': 'anion,alarm,horizontal_swing,vertical_swing', + 'number_properties': 'horizontal_angle,vertical_angle,off_delay', + }, 'zhimi.heater.na1': { 'switch_properties': 'return_to_middle,alarm', 'number_properties': 'countdown_time',