From 7785426f707141428d639aad3a46b63bce71da57 Mon Sep 17 00:00:00 2001 From: wangyz1997 Date: Tue, 16 Jul 2024 22:52:09 +0800 Subject: [PATCH 1/2] fix wrong button action for yeelink.switch.ylsw7 --- custom_components/xiaomi_gateway3/core/devices.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/xiaomi_gateway3/core/devices.py b/custom_components/xiaomi_gateway3/core/devices.py index 41b4fb8d..38691de9 100644 --- a/custom_components/xiaomi_gateway3/core/devices.py +++ b/custom_components/xiaomi_gateway3/core/devices.py @@ -2169,7 +2169,7 @@ ConstConv("action", mi="15.e.2", value=BUTTON_2_DOUBLE), ConstConv("action", mi="15.e.3", value=BUTTON_2_HOLD), ConstConv("action", mi="16.e.1", value=BUTTON_3_SINGLE), - ConstConv("action", mi="16.e.2", value=BUTTON_2_DOUBLE), + ConstConv("action", mi="16.e.2", value=BUTTON_3_DOUBLE), ConstConv("action", mi="16.e.3", value=BUTTON_3_HOLD), ConstConv("action", mi="17.e.1", value=BUTTON_4_SINGLE), ConstConv("action", mi="17.e.2", value=BUTTON_4_DOUBLE), From f582a53ec683a74bb46663259f479c7405bf0d0e Mon Sep 17 00:00:00 2001 From: wangyz1997 Date: Tue, 16 Jul 2024 22:52:41 +0800 Subject: [PATCH 2/2] add support for mvs.light.wy0a01 and lemesh.light.w00a02 --- .../xiaomi_gateway3/core/devices.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/custom_components/xiaomi_gateway3/core/devices.py b/custom_components/xiaomi_gateway3/core/devices.py index 38691de9..44e25671 100644 --- a/custom_components/xiaomi_gateway3/core/devices.py +++ b/custom_components/xiaomi_gateway3/core/devices.py @@ -2059,6 +2059,31 @@ MapConv("dimming", "select", mi="4.p.3", map={0: "Gradient", 1: "Immediately"}), BoolConv("night_light", "switch", mi="4.p.5"), ] +}, { + 17964: ["LeMesh", "Smart downlight Mesh version", "mvs.light.wy0a01"], + "spec": [ + BaseConv("light", "light", mi="2.p.1"), + BrightnessConv("brightness", mi="2.p.2", max=100), + ColorTempKelvin("color_temp", mi="2.p.3", mink=2700, maxk=6500), + MapConv("mode", "select", mi="2.p.7", map={0: "None", 4: "Sun", 5: "Moon", 7: "Warmth", 8: "Cinema", 9: "Reading", 10: "Computer", 11: "Hospitality", 12: "Entertainment", 13: "Wakeup", 14: "Dusk", 15: "Sleep", 16: "Custom1", 17: "Custom2", 18: "Custom3", 19: "Custom4"}), + MapConv("power_on_state", "select", mi="2.p.9", map={0: "Default", 1: "ON", 2: "OFF"}), # config + BaseConv("flex_switch", "switch", mi="2.p.12"), # uint8, config + BoolConv("night_light", "switch", mi="2.p.13", entity=ENTITY_CONFIG), # config + BoolConv("save_state", "switch", mi="5.p.1", entity=ENTITY_CONFIG), # config + MapConv("dimming", "select", mi="5.p.2", map={0: "Gradient", 1: "Immediately"}, entity=ENTITY_CONFIG), # config + ] +}, { + 17157: ["LeMesh", "Scene Mesh monochrome light V2S series", "lemesh.light.w00a02"], + "spec": [ + BaseConv("light", "light", mi="2.p.1"), + BrightnessConv("brightness", mi="2.p.2", max=100), + MapConv("mode", "select", mi="2.p.7", map={0: "None", 4: "Sun", 5: "Moon", 7: "Warmth", 8: "Cinema", 9: "Reading", 10: "Computer", 11: "Hospitality", 12: "Entertainment", 13: "Wakeup", 14: "Dusk", 15: "Sleep", 16: "Custom1", 17: "Custom2", 18: "Custom3", 19: "Custom4", 20: "Breath", 21: "Jump"}), + MapConv("power_on_state", "select", mi="2.p.9", map={0: "Default", 1: "ON", 2: "OFF"}), # config + BaseConv("flex_switch", "switch", mi="2.p.12"), # uint8, config + BoolConv("night_light", "switch", mi="2.p.13", entity=ENTITY_CONFIG), # config + BoolConv("save_state", "switch", mi="5.p.1", entity=ENTITY_CONFIG), # config + MapConv("dimming", "select", mi="5.p.2", map={0: "Gradient", 1: "Immediately"}, entity=ENTITY_CONFIG), # config + ] }, { 10729: [None, "Mesh Light", "jymc.light.falmp"], 12066: [None, "Mesh Light", "ftd.light.ftdlmp"],