فهرست منبع

BCom intercom camera: improved config

- Invert locks: true is unlocked, false locked
- Merge SD capacity into attribute of SD status, SD Format status into
  attribute of SD Format button. These are not interesting enough to be
  sensor entities.
- handle empty string for doorbell idle state

Issue #2835
Jason Rumney 1 سال پیش
والد
کامیت
a6564b55ee
1فایلهای تغییر یافته به همراه38 افزوده شده و 14 حذف شده
  1. 38 14
      custom_components/tuya_local/devices/bcom_intercom_camera.yaml

+ 38 - 14
custom_components/tuya_local/devices/bcom_intercom_camera.yaml

@@ -33,6 +33,11 @@ entities:
         type: boolean
         optional: true
         name: lock
+        mapping:
+          - dps_val: true
+            value: false
+          - dps_val: false
+            value: true
   - entity: light
     translation_key: indicator
     category: config
@@ -90,14 +95,6 @@ entities:
             value: "Off"
           - dps_val: "2"
             value: "On"
-  - entity: sensor
-    name: SD capacity
-    category: diagnostic
-    dps:
-      - id: 109
-        type: string
-        optional: true
-        name: sensor
   - entity: sensor
     name: SD status
     category: diagnostic
@@ -106,8 +103,23 @@ entities:
         type: integer
         optional: true
         name: sensor
+        mapping:
+          - dps_val: 1
+            value: normal
+          - dps_val: 2
+            value: error
+          - dps_val: 3
+            value: full
+          - dps_val: 4
+            value: formatting
+          - dps_val: 5
+            value: missing
+      - id: 109
+        type: string
+        optional: true
+        name: capacity
   - entity: button
-    name: SD format
+    name: Format SD
     category: config
     icon: "mdi:micro-sd"
     dps:
@@ -115,14 +127,19 @@ entities:
         type: boolean
         optional: true
         name: button
-  - entity: sensor
-    name: SD format state
-    category: diagnostic
-    dps:
       - id: 117
         type: integer
         optional: true
-        name: sensor
+        name: status
+        mapping:
+          - dps_val: 2000
+            value: Formatting
+          - dps_val: 2001
+            value: Format error
+          - dps_val: 2002
+            value: Card missing
+          - dps_val: 2003
+            value: Card error
   - entity: select
     name: Recording mode
     icon: "mdi:file-video"
@@ -164,6 +181,8 @@ entities:
         mapping:
           - dps_val: null
             value: null
+          - dps_val: ""
+            value: null
           - value: ring
       - id: 136
         type: string
@@ -176,3 +195,8 @@ entities:
         type: boolean
         optional: true
         name: lock
+        mapping:
+          - dps_val: true
+            value: false
+          - dps_val: false
+            value: true