Просмотр исходного кода

Matsee V2: use binary sensor for direction

Using new translation_key: direction, the direction sensors can look good
as binary sensors.
Jason Rumney 1 год назад
Родитель
Сommit
01b0b843ee
1 измененных файлов с 30 добавлено и 0 удалено
  1. 30 0
      custom_components/tuya_local/devices/matsee_2wayv2_energymeter.yaml

+ 30 - 0
custom_components/tuya_local/devices/matsee_2wayv2_energymeter.yaml

@@ -308,8 +308,23 @@ entities:
         name: calibration
         name: calibration
         mapping:
         mapping:
           - scale: 1000
           - scale: 1000
+  - entity: binary_sensor
+    name: Direction B
+    translation_key: direction
+    category: diagnostic
+    dps:
+      - id: 124
+        type: boolean
+        name: sensor
+        mapping:
+          - dps_val: false
+            value: true
+          - dps_val: true
+            value: false
   - entity: sensor
   - entity: sensor
     name: Direction B
     name: Direction B
+    # 2025-01-29
+    deprecated: binary_sensor
     class: enum
     class: enum
     category: diagnostic
     category: diagnostic
     dps:
     dps:
@@ -321,9 +336,24 @@ entities:
             value: in
             value: in
           - dps_val: false
           - dps_val: false
             value: out
             value: out
+  - entity: binary_sensor
+    name: Direction A
+    translation_key: direction
+    category: diagnostic
+    dps:
+      - id: 125
+        type: boolean
+        name: sensor
+        mapping:
+          - dps_val: false
+            value: true
+          - dps_val: true
+            value: false
   - entity: sensor
   - entity: sensor
     name: Direction A
     name: Direction A
     class: enum
     class: enum
+    # 2025-01-29
+    deprecated: binary_sensor
     category: diagnostic
     category: diagnostic
     dps:
     dps:
       - id: 125
       - id: 125