From 41b83f7e6df2d42372031abfdcd42c229eb5d392 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Sun, 8 Dec 2024 17:33:51 +0900 Subject: [PATCH] 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 --- .../devices/tompd_63lw_breaker.yaml | 53 ++++++++++++------- tests/devices/test_tompd63lw_breaker.py | 4 +- 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/custom_components/tuya_local/devices/tompd_63lw_breaker.yaml b/custom_components/tuya_local/devices/tompd_63lw_breaker.yaml index f9e6deb9c2..02ba3d6088 100644 --- a/custom_components/tuya_local/devices/tompd_63lw_breaker.yaml +++ b/custom_components/tuya_local/devices/tompd_63lw_breaker.yaml @@ -4,8 +4,8 @@ products: name: TOMPD-63LW - id: psjg8ldomxnelfp5 name: TOMZN-63A - - id: wcihaluccfsoayqa - name: TOMPD-63WIFI + - id: u0cxoxtfelys3ufx + name: TOMPD-63LW primary_entity: entity: switch icon: "mdi:fuse" @@ -167,29 +167,44 @@ secondary_entities: type: bitfield name: fault_code 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 - icon: "mdi:timer" + dps: + - id: 101 + type: boolean + name: button + optional: true + - entity: sensor + class: power_factor + category: diagnostic dps: - id: 104 type: integer 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: - id: 105 type: integer optional: true - name: value - unit: s - range: - min: 1 - max: 500 + name: sensor + unit: Hz + class: measurement + mapping: + - scale: 10 diff --git a/tests/devices/test_tompd63lw_breaker.py b/tests/devices/test_tompd63lw_breaker.py index 40a60f8321..0561c478e5 100644 --- a/tests/devices/test_tompd63lw_breaker.py +++ b/tests/devices/test_tompd63lw_breaker.py @@ -64,12 +64,12 @@ def setUp(self): "button_energy_reset", "button_refresh_sensors", "number_charge_energy", - "number_voltage_protection_time", - "number_voltage_recovery_time", "sensor_balance_energy", "sensor_current", + "sensor_frequency", "sensor_leakage_current", "sensor_power", + "sensor_power_factor", "sensor_voltage", "switch_prepayment", ]