From c25f0bb1ce6e09850897bad95a72b52610ddf8e4 Mon Sep 17 00:00:00 2001 From: Meteor Liu Date: Tue, 8 Oct 2024 21:07:29 +0800 Subject: [PATCH] according to this spac https://home.miot-spec.com/spec/loock.lock.v2203#srv-4 map more state about `changing` --- custom_components/xiaomi_gateway3/core/devices.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/custom_components/xiaomi_gateway3/core/devices.py b/custom_components/xiaomi_gateway3/core/devices.py index 110c60c3..39b60483 100644 --- a/custom_components/xiaomi_gateway3/core/devices.py +++ b/custom_components/xiaomi_gateway3/core/devices.py @@ -1933,7 +1933,16 @@ # small battery sensor BaseConv("battery", "sensor", mi="4.p.1003"), # charging state - BaseConv("changing", "sensor", mi="4.p.1034"), + MapConv("changing", "sensor", mi="4.p.1034", map={ + 0: 'All Not Inserted', + 1: 'Large Inserted', + 2: 'Small Inserted', + 3: 'Large And Small Inserted', + 4: 'USB Inserted', + 5: 'USB Inserted And Large Inserted', + 6: 'USB Inserted And Small Inserted', + 7: 'All Inserted' + }), # doorbell ConstConv("action", mi="5.e.1006", value="doorbell"), # doorbell timestamp