From 11becdb858b3c770b5d7aeca122becbcee5d455c Mon Sep 17 00:00:00 2001 From: Levkan <105607530+levkanm@users.noreply.github.com> Date: Thu, 8 Feb 2024 21:44:42 +0800 Subject: [PATCH 1/2] Update devices.py support xingh.light.fsd2 --- .../xiaomi_gateway3/core/converters/devices.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/custom_components/xiaomi_gateway3/core/converters/devices.py b/custom_components/xiaomi_gateway3/core/converters/devices.py index d18c2366..60a71e96 100644 --- a/custom_components/xiaomi_gateway3/core/converters/devices.py +++ b/custom_components/xiaomi_gateway3/core/converters/devices.py @@ -1366,6 +1366,20 @@ }), ], "ttl": "6h" # battery every 6 hours +}, { # https://home.miot-spec.com/spec?type=urn:miot-spec-v2:device:light:0000A001:xingh-fsd2:1:0000C802 + 12385: ["Unknown", "Mesh Ceiling Fan Light", "xingh.light.fsd2"], + "spec": [ + Converter("light", "light", mi="2.p.1"), + BrightnessConv("brightness", mi="2.p.2", parent="light", max=100), + ColorTempKelvin("color_temp", mi="2.p.3", parent="light", mink=2700, maxk=6500), + MapConv("light_mode", "select", mi="2.p.4", parent="light", map={ + 0: "Reading", 1: "Office", 2: "Night", 3: "Leisure", 4: "W", 5: "WY", 6: "Night Light", 7: "Y", 8: "None"}), + Converter("fan", "fan", mi="3.p.1"), + Converter("horizontal_swing", mi="3.p.3", parent="fan"), + Converter("wind_reverse", mi="3.p.12", parent="fan"), + BoolConv("natural_wind", mi="3.p.7", parent="fan"), + Converter("fan_level", mi="3.p.2", parent="fan"), + ] }, { 6742: ["Le", "Wireless Button", "lemesh.remote.ts1"], "spec": [ From 76b1519d1bafc752c9d3c1d2c2e4e91396b2b49d Mon Sep 17 00:00:00 2001 From: Levkan <105607530+levkanm@users.noreply.github.com> Date: Mon, 12 Feb 2024 23:33:51 +0800 Subject: [PATCH 2/2] support xingh.light.fsd2 support xingh.light.fsd2 --- .../xiaomi_gateway3/core/converters/devices.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/custom_components/xiaomi_gateway3/core/converters/devices.py b/custom_components/xiaomi_gateway3/core/converters/devices.py index 60a71e96..09d51c1f 100644 --- a/custom_components/xiaomi_gateway3/core/converters/devices.py +++ b/custom_components/xiaomi_gateway3/core/converters/devices.py @@ -1374,11 +1374,12 @@ ColorTempKelvin("color_temp", mi="2.p.3", parent="light", mink=2700, maxk=6500), MapConv("light_mode", "select", mi="2.p.4", parent="light", map={ 0: "Reading", 1: "Office", 2: "Night", 3: "Leisure", 4: "W", 5: "WY", 6: "Night Light", 7: "Y", 8: "None"}), - Converter("fan", "fan", mi="3.p.1"), - Converter("horizontal_swing", mi="3.p.3", parent="fan"), - Converter("wind_reverse", mi="3.p.12", parent="fan"), - BoolConv("natural_wind", mi="3.p.7", parent="fan"), - Converter("fan_level", mi="3.p.2", parent="fan"), + Converter("fan", "switch", mi="3.p.1"), + Converter("horizontal_swing", "switch", mi="3.p.3"), + Converter("wind_reverse", "switch", mi="3.p.12"), + BoolConv("natural_wind", "switch", mi="3.p.7"), + MapConv("fan_level", "select", mi="3.p.2", map={ + 1: "1", 2: "2", 3: "3", 4: "4", 5: "5", 6: "6"}), ] }, { 6742: ["Le", "Wireless Button", "lemesh.remote.ts1"],