Browse Source

TOMPD-63LW: revert additions from TOMPD-63WIFI, add TOMPD-63LW v2

Two "new" configs were submitted at the same time:
TOMPD-63-WIFI, and another variant of TOMPD-63LW

Initial analysis showed that the TOMPD-63-WIFI was closer to the original
TOMPD-63LW config, but actually both are just extending it with a few new
entities that can be made optional, and the -WIFI one actually removed
some entities that the 63LW didn't.

Both added numeric dps 104 and 105, but the WIFI has them as config options
for Over/Under voltage handling timeouts, while the 63LW has them as sensors
(power factor and frequency).

Since the 63LW is the same name, it should probably get priority.

PR #2619, reverting previous config merge of PR #2618
Jason Rumney 1 year ago
parent
commit
41b83f7e6d

+ 34 - 19
custom_components/tuya_local/devices/tompd_63lw_breaker.yaml

@@ -4,8 +4,8 @@ products:
     name: TOMPD-63LW
     name: TOMPD-63LW
   - id: psjg8ldomxnelfp5
   - id: psjg8ldomxnelfp5
     name: TOMZN-63A
     name: TOMZN-63A
-  - id: wcihaluccfsoayqa
-    name: TOMPD-63WIFI
+  - id: u0cxoxtfelys3ufx
+    name: TOMPD-63LW
 primary_entity:
 primary_entity:
   entity: switch
   entity: switch
   icon: "mdi:fuse"
   icon: "mdi:fuse"
@@ -167,29 +167,44 @@ secondary_entities:
         type: bitfield
         type: bitfield
         name: fault_code
         name: fault_code
         optional: true
         optional: true
-  - entity: number
-    name: Voltage protection time
+  - entity: button
+    translation_key: factory_reset
+    category: config
+    dps:
+      - id: 34
+        type: boolean
+        name: button
+        optional: true
+  - entity: button
+    name: Clear energy
+    class: restart
     category: config
     category: config
-    icon: "mdi:timer"
+    dps:
+      - id: 101
+        type: boolean
+        name: button
+        optional: true
+  - entity: sensor
+    class: power_factor
+    category: diagnostic
     dps:
     dps:
       - id: 104
       - id: 104
         type: integer
         type: integer
         optional: true
         optional: true
-        name: value
-        unit: s
-        range:
-          min: 1
-          max: 30
-  - entity: number
-    name: Voltage recovery time
-    category: config
-    icon: "mdi:timer"
+        name: sensor
+        unit: "%"
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    class: frequency
+    category: diagnostic
     dps:
     dps:
       - id: 105
       - id: 105
         type: integer
         type: integer
         optional: true
         optional: true
-        name: value
-        unit: s
-        range:
-          min: 1
-          max: 500
+        name: sensor
+        unit: Hz
+        class: measurement
+        mapping:
+          - scale: 10

+ 2 - 2
tests/devices/test_tompd63lw_breaker.py

@@ -64,12 +64,12 @@ class TestTOMPD63lw(MultiSensorTests, TuyaDeviceTestCase):
                 "button_energy_reset",
                 "button_energy_reset",
                 "button_refresh_sensors",
                 "button_refresh_sensors",
                 "number_charge_energy",
                 "number_charge_energy",
-                "number_voltage_protection_time",
-                "number_voltage_recovery_time",
                 "sensor_balance_energy",
                 "sensor_balance_energy",
                 "sensor_current",
                 "sensor_current",
+                "sensor_frequency",
                 "sensor_leakage_current",
                 "sensor_leakage_current",
                 "sensor_power",
                 "sensor_power",
+                "sensor_power_factor",
                 "sensor_voltage",
                 "sensor_voltage",
                 "switch_prepayment",
                 "switch_prepayment",
             ]
             ]