Browse Source

BLE KB150A lock: changes before merge

- follow HA naming convention
- add extra spaces to keep yamllint happy
- convert Alert sensor to event

PR #2824
Jason Rumney 1 year ago
parent
commit
cc0163fb39
1 changed files with 19 additions and 22 deletions
  1. 19 22
      custom_components/tuya_local/devices/ble_smart_lock_kb150a.yaml

+ 19 - 22
custom_components/tuya_local/devices/ble_smart_lock_kb150a.yaml

@@ -1,4 +1,4 @@
-name: Keypad Lock
+name: Keypad lock
 products:
   - id: 0binhnjg
     manufacturer: TenixLox
@@ -46,14 +46,14 @@ entities:
         type: integer
         optional: true
         persist: false
-      - id: 47 # Lock motor state
+      - id: 47  # Lock motor state
         name: lock
         type: boolean
         readonly: true
         mapping:
-          - dps_val: true # Unlocked
+          - dps_val: true  # Unlocked
             value: false
-          - dps_val: false # Locked
+          - dps_val: false  # Locked
             value: true
       - id: 55
         type: integer
@@ -65,42 +65,38 @@ entities:
         name: remote_no_dp_key
         optional: true
         persist: false
+        sensitive: true
       - id: 62
         type: integer
         name: unlock_app
         optional: true
         persist: false
-  - entity: sensor
+  - entity: event
     name: Alert
-    class: enum
-    category: diagnostic
     dps:
       - id: 21
         type: string
-        name: sensor
+        name: event
         optional: true
-        persist: false
         mapping:
-          - dps_val: null
-            value: All Good
           - dps_val: wrong_finger
-            value: Wrong Finger
+            value: wrong_finger
           - dps_val: wrong_password
-            value: Wrong Password
+            value: wrong_password
           - dps_val: wrong_card
-            value: Wrong Card
+            value: wrong_card
           - dps_val: tongue_bad
-            value: Tongue Bad
+            value: tongue_bad
           - dps_val: unclosed_time
-            value: Unclosed Time
+            value: unclosed_time
           - dps_val: tongue_not_out
-            value: Tongue Not Out
+            value: tongue_not_out
           - dps_val: pry
-            value: Pry
+            value: pry
           - dps_val: low_battery
-            value: Low Battery
+            value: low_battery
           - dps_val: power_off
-            value: Power Off
+            value: power_off
   - entity: select
     name: Lock volume
     category: config
@@ -118,7 +114,7 @@ entities:
           - dps_val: high
             value: High
   - entity: switch
-    name: Auto Lock
+    name: Auto lock
     category: config
     icon: "mdi:lock-reset"
     dps:
@@ -127,6 +123,7 @@ entities:
         name: switch
   - entity: number
     name: Auto lock delay
+    class: duration
     icon: "mdi:lock-clock"
     category: config
     dps:
@@ -138,7 +135,7 @@ entities:
           min: 1
           max: 1800
   - entity: switch
-    name: Do Not Disturb
+    name: Do not disturb
     category: config
     icon: "mdi:sleep"
     dps: