Quellcode durchsuchen

TOMPD631LW: add additional tests for decoding the phase_a attribute

Based on comment on #577, user is seeing original undecoded values for V, I, P.
But the tests with the same input work OK, so possibly they have only partially
updated, or are testing a different device that has an issue.
Jason Rumney vor 2 Jahren
Ursprung
Commit
956c693448
1 geänderte Dateien mit 6 neuen und 0 gelöschten Zeilen
  1. 6 0
      tests/devices/test_tompd63lw_breaker.py

+ 6 - 0
tests/devices/test_tompd63lw_breaker.py

@@ -70,3 +70,9 @@ class TestTOMPD63lw(MultiSensorTests, TuyaDeviceTestCase):
                 "switch_prepayment",
             ]
         )
+
+    def test_phasea_encoding(self):
+        self.dps[PHASEA_DP] = "CMAAD6AAAzUAAA=="
+        self.assertEqual(self.multiSensor["sensor_voltage_a"].native_value, 224.0)
+        self.assertEqual(self.multiSensor["sensor_current_a"].native_value, 4000)
+        self.assertEqual(self.multiSensor["sensor_power_a"].native_value, 821.0)