Kaynağa Gözat

Positivo smart keypad: update to modern format

- merge entities to a single list
- split manufacturer and model in product details
- some tweaks to entity types and names to standardise relative to other devices, and make use of existing translations.

PR #3063
Jason Rumney 9 ay önce
ebeveyn
işleme
52a3d1cdef

+ 86 - 89
custom_components/tuya_local/devices/ble_positivo_smart_keypad.yaml

@@ -1,102 +1,99 @@
-name: Positivo Smart KeyPad
+name: Keypad lock
 products:
   - id: bb0nmoax
-    name: Positivo Smart KeyPad
-primary_entity:
-  entity: lock
-  dps:
-    - id: 1
-      type: string
-      name: unlock_method_create
-      optional: true
-    - id: 2
-      type: string
-      name: unlock_method_delete
-      optional: true
-    - id: 3
-      type: string
-      name: unlock_method_modify
-      optional: true
-    - id: 4
-      type: string
-      name: temporary_password_creat
-      optional: true
-    - id: 5
-      type: string
-      name: temporary_password_delete
-      optional: true
-    - id: 6
-      type: string
-      name: temporary_password_modify
-      optional: true
-    - id: 7
-      type: base64
-      name: synch_method
-      optional: true
-    - id: 51
-      type: string
-      name: unlock_password_kit
-      optional: true
-    - id: 58
-      type: string
-      name: unlock_temporary_kit
-      optional: true
-    - id: 60
-      type: string
-      name: alarm_lock
-      readonly: true
-      optional: true
-      mapping:
-        - dps_val: low_battery
-          value: low_battery
-        - dps_val: power_off
-          value: power_off
-    - id: 70
-      type: string
-      name: password_offline_time
-      optional: true
-    - id: 71
-      type: string
-      name: unlock_offline_clear_single
-      optional: true
-    - id: 72
-      type: string
-      name: unlock_offline_clear
-      optional: true
-    - id: 73
-      type: string
-      name: unlock_offline_pwd
-      optional: true
-      persist: false
-    - id: 74
-      type: integer
-      name: unlock_dynamic_pwd
-      optional: true
-      persist: false
-    - id: 91
-      type: boolean
-      name: message
-      optional: true
-secondary_entities:
-  - entity: select
+    manufacturer: Positivo
+    model: Smart KeyPad
+entities:
+  - entity: lock
+    dps:
+      - id: 1
+        type: string
+        name: unlock_method_create
+        optional: true
+      - id: 2
+        type: string
+        name: unlock_method_delete
+        optional: true
+      - id: 3
+        type: string
+        name: unlock_method_modify
+        optional: true
+      - id: 4
+        type: string
+        name: temporary_password_creat
+        optional: true
+      - id: 5
+        type: string
+        name: temporary_password_delete
+        optional: true
+      - id: 6
+        type: string
+        name: temporary_password_modify
+        optional: true
+      - id: 7
+        type: base64
+        name: synch_method
+        optional: true
+      - id: 51
+        type: string
+        name: unlock_password_kit
+        optional: true
+      - id: 58
+        type: string
+        name: unlock_temporary_kit
+        optional: true
+      - id: 60
+        type: string
+        name: alarm_lock
+        readonly: true
+        optional: true
+        mapping:
+          - dps_val: low_battery
+            value: low_battery
+          - dps_val: power_off
+            value: power_off
+      - id: 70
+        type: string
+        name: password_offline_time
+        optional: true
+      - id: 71
+        type: string
+        name: unlock_offline_clear_single
+        optional: true
+      - id: 72
+        type: string
+        name: unlock_offline_clear
+        optional: true
+      - id: 73
+        type: string
+        name: unlock_offline_pwd
+        optional: true
+        persist: false
+      - id: 74
+        type: integer
+        name: unlock_dynamic_pwd
+        optional: true
+        persist: false
+      - id: 91
+        type: boolean
+        name: message
+        optional: true
+  - entity: switch
     category: config
-    name: Key Tone
-    icon: "mdi:volume-high"
+    translation_key: keytone
     dps:
       - id: 22
-        name: option
+        name: switch
         type: string
         optional: true
         mapping:
           - dps_val: mute
-            value: mute
-            icon: "mdi:volume-mute"
+            value: false
           - dps_val: normal
-            value: normal
-            icon: mdi:volume-medium
+            value: true
   - entity: switch
     category: config
-    name: Switch Verify Lock
+    name: Verify Lock
     dps:
       - id: 27
         type: boolean
@@ -127,9 +124,9 @@ secondary_entities:
         unit: "%"
         class: measurement
   - entity: sensor
-    name: Batery State
+    name: Batery state
     class: enum
-    icon: "mdi:alert"
+    icon: "mdi:battery"
     category: diagnostic
     dps:
       - id: 41