|
|
@@ -130,10 +130,6 @@ class TestSwitchV2Energy(
|
|
|
|
|
|
def test_multi_switch_state_attributes(self):
|
|
|
self.dps[TEST_DPS] = 21
|
|
|
- self.dps[CALIBV_DPS] = 22
|
|
|
- self.dps[CALIBI_DPS] = 23
|
|
|
- self.dps[CALIBP_DPS] = 24
|
|
|
- self.dps[CALIBE_DPS] = 25
|
|
|
self.dps[ERROR_DPS] = 26
|
|
|
self.dps[CYCLE_DPS] = "1A2B"
|
|
|
self.dps[RANDOM_DPS] = "3C4D"
|
|
|
@@ -142,12 +138,31 @@ class TestSwitchV2Energy(
|
|
|
self.multiSwitch["switch"].extra_state_attributes,
|
|
|
{
|
|
|
"test_bit": 21,
|
|
|
- "voltage_calibration": 22,
|
|
|
- "current_calibration": 23,
|
|
|
- "power_calibration": 24,
|
|
|
- "energy_calibration": 25,
|
|
|
"fault_code": 26,
|
|
|
"cycle_timer": "1A2B",
|
|
|
"random_timer": "3C4D",
|
|
|
},
|
|
|
)
|
|
|
+
|
|
|
+ def test_multi_sensor_extra_state_attributes(self):
|
|
|
+ self.dps[CALIBV_DPS] = 22
|
|
|
+ self.dps[CALIBI_DPS] = 23
|
|
|
+ self.dps[CALIBP_DPS] = 24
|
|
|
+ self.dps[CALIBE_DPS] = 25
|
|
|
+
|
|
|
+ self.assertDictEqual(
|
|
|
+ self.multiSensor["sensor_current"].extra_state_attributes,
|
|
|
+ {"calibration": 23},
|
|
|
+ )
|
|
|
+ self.assertDictEqual(
|
|
|
+ self.multiSensor["sensor_energy"].extra_state_attributes,
|
|
|
+ {"calibration": 25},
|
|
|
+ )
|
|
|
+ self.assertDictEqual(
|
|
|
+ self.multiSensor["sensor_power"].extra_state_attributes,
|
|
|
+ {"calibration": 24},
|
|
|
+ )
|
|
|
+ self.assertDictEqual(
|
|
|
+ self.multiSensor["sensor_voltage"].extra_state_attributes,
|
|
|
+ {"calibration": 22},
|
|
|
+ )
|