Răsfoiți Sursa

Primebras lock: fix dp type, and add missing dps.

- modify match_against development util to take two filenames or as
before a filename and a config on the command line.

This makes analysis between two already existing files easier.
Jason Rumney 9 luni în urmă
părinte
comite
10237703d4

+ 11 - 1
custom_components/tuya_local/devices/primebras_athenas_lock.yaml

@@ -125,9 +125,14 @@ entities:
         optional: true
         optional: true
         persist: false
         persist: false
       - id: 64
       - id: 64
-        type: base64
+        type: string
         optional: true
         optional: true
         name: pwd_offline_time
         name: pwd_offline_time
+      - id: 67
+        type: base64
+        optional: true
+        persist: false
+        name: unlock_offline_pwd
       - id: 69
       - id: 69
         type: string
         type: string
         optional: true
         optional: true
@@ -147,6 +152,11 @@ entities:
         optional: true
         optional: true
         sensitive: true
         sensitive: true
         name: remote_pd_setkey_check
         name: remote_pd_setkey_check
+      - id: 74
+        type: base64
+        optional: true
+        sensitive: true
+        name: unlock_multi
   - entity: sensor
   - entity: sensor
     class: battery
     class: battery
     dps:
     dps:

+ 7 - 2
util/match_against.py

@@ -3,13 +3,18 @@
 import json
 import json
 import sys
 import sys
 
 
-from common_funcs import FakeDevice, load_config
+from common_funcs import FakeDevice, load_config, make_sample_dps
 
 
 from custom_components.tuya_local.helpers.device_config import _typematch
 from custom_components.tuya_local.helpers.device_config import _typematch
 
 
 
 
 def main() -> int:
 def main() -> int:
-    dps = json.loads(" ".join(sys.argv[2:]))
+    rest = " ".join(sys.argv[2:])
+    config = load_config(rest)
+    if config is None:
+        dps = json.loads(rest)
+    else:
+        dps = make_sample_dps(config)
     device = FakeDevice(dps)
     device = FakeDevice(dps)
     config = load_config(sys.argv[1])
     config = load_config(sys.argv[1])
     if config is None:
     if config is None: