From e053992516b274d4a49e08d666e5c78ea0c7917c Mon Sep 17 00:00:00 2001 From: flyibeat <78073839+flyibeat@users.noreply.github.com> Date: Sat, 26 Aug 2023 10:53:01 +0800 Subject: [PATCH 1/3] =?UTF-8?q?Update=20PTX=20Curtain=20Motor=20=E2=80=9Cc?= =?UTF-8?q?rus6=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xiaomi_gateway3/core/converters/devices.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/custom_components/xiaomi_gateway3/core/converters/devices.py b/custom_components/xiaomi_gateway3/core/converters/devices.py index 322b13cd..9c14aa54 100644 --- a/custom_components/xiaomi_gateway3/core/converters/devices.py +++ b/custom_components/xiaomi_gateway3/core/converters/devices.py @@ -2300,6 +2300,23 @@ }, enabled=False), ] }, { + # https://home.miot-spec.com/spec/090615.curtain.crus6 + 15069: ["PTX", "Curtain Motor", "crus6"], + "spec": [ + MapConv("motor", "cover", mi="2.p.1", map={0: "stop", 1: "open", 2: "close"}), + Converter("target_position", mi="2.p.2"), + CurtainPosConv("position", mi="2.p.3", parent="motor"), + Converter("motor_reverse", "switch", mi="2.p.4", enabled=False), + MapConv("mode", "select", mi="2.p.5", map={ + 0: "default", 1: "doublmode", 2: "leftmode", 3: "rightmode" + }, enabled=False), + MapConv("run_state", mi="2.p.6", parent="motor", map={ + 0: "stop", 1: "opening", 2: "closing" + }), + MapConv("fault", "sensor", mi="2.p.7", map={ + 0: "No faults", 1: "Faults"}, enabled=False), + ], +}, { 4722: ["Xiaomi", "Curtain Motor", "MJZNCL02LM"], "spec": [ MapConv("motor", "cover", mi="2.p.1", map={ From 3f68dc89234eec0cece3f4d4b3a2a7d53bd5bffd Mon Sep 17 00:00:00 2001 From: flyibeat <78073839+flyibeat@users.noreply.github.com> Date: Sat, 26 Aug 2023 11:15:59 +0800 Subject: [PATCH 2/3] add PTX Curtain Motor "crus6" --- custom_components/xiaomi_gateway3/core/converters/devices.py | 1 + 1 file changed, 1 insertion(+) diff --git a/custom_components/xiaomi_gateway3/core/converters/devices.py b/custom_components/xiaomi_gateway3/core/converters/devices.py index 9c14aa54..e5fac6ef 100644 --- a/custom_components/xiaomi_gateway3/core/converters/devices.py +++ b/custom_components/xiaomi_gateway3/core/converters/devices.py @@ -2316,6 +2316,7 @@ MapConv("fault", "sensor", mi="2.p.7", map={ 0: "No faults", 1: "Faults"}, enabled=False), ], + "ttl": "15m", }, { 4722: ["Xiaomi", "Curtain Motor", "MJZNCL02LM"], "spec": [ From b30b8f920ebd37d5405854595c081d632a30730e Mon Sep 17 00:00:00 2001 From: flyibeat <78073839+flyibeat@users.noreply.github.com> Date: Sat, 26 Aug 2023 20:25:23 +0800 Subject: [PATCH 3/3] Fix errors that 'become unavailable every 20 minutes' curtain motor will become unavailable every 20 minutes --- custom_components/xiaomi_gateway3/core/converters/devices.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom_components/xiaomi_gateway3/core/converters/devices.py b/custom_components/xiaomi_gateway3/core/converters/devices.py index e5fac6ef..0f8f4c38 100644 --- a/custom_components/xiaomi_gateway3/core/converters/devices.py +++ b/custom_components/xiaomi_gateway3/core/converters/devices.py @@ -2298,7 +2298,8 @@ MapConv("mode", "select", mi="2.p.5", map={ 0: "default", 1: "doublmode", 2: "leftmode", 3: "rightmode" }, enabled=False), - ] + ], + "ttl": "7d", }, { # https://home.miot-spec.com/spec/090615.curtain.crus6 15069: ["PTX", "Curtain Motor", "crus6"], @@ -2316,7 +2317,7 @@ MapConv("fault", "sensor", mi="2.p.7", map={ 0: "No faults", 1: "Faults"}, enabled=False), ], - "ttl": "15m", + "ttl": "7d", }, { 4722: ["Xiaomi", "Curtain Motor", "MJZNCL02LM"], "spec": [