@@ -459,8 +459,9 @@ async def device_test(self, smile=pw_smile.Smile, testdata=None):
459459 if a_item ["id" ] != b_item ["id" ]:
460460 continue
461461
462- if type (a_item ["state" ]) is list :
463- assert a_item ["state" ][0 ] == b_item ["state" ]
462+ if type (b_item ["state" ]) is list :
463+ assert a_item ["state" ] == b_item ["state" ][0 ]
464+ assert a_item ["last_reset" ] == b_item ["state" ][1 ]
464465 else :
465466 assert a_item ["state" ] == b_item ["state" ]
466467 b_sensor = None
@@ -1517,9 +1518,8 @@ async def test_connect_p1v3(self):
15171518 "state" : 10263.159 ,
15181519 },
15191520 {
1520- "id" : "electricity_produced_peak_interval" ,
1521- "state" : 179 ,
1522- "last_reset" : dt .datetime (2020 , 3 , 12 , 19 , 45 ),
1521+ "id" : "electricity_consumed_peak_interval" ,
1522+ "state" : [179 , dt .datetime (2020 , 3 , 12 , 19 , 45 )],
15231523 },
15241524 ]
15251525 }
@@ -1764,8 +1764,7 @@ async def test_connect_stretch_v31(self):
17641764 "sensors" : [
17651765 {
17661766 "id" : "electricity_consumed_interval" ,
1767- "state" : 0.71 ,
1768- "last_reset" : dt .datetime (2020 , 9 , 6 , 12 , 00 ),
1767+ "state" : [0.71 , dt .datetime (2020 , 9 , 6 , 12 , 00 )],
17691768 }
17701769 ]
17711770 },
@@ -1809,8 +1808,7 @@ async def test_connect_stretch_v23(self):
18091808 "sensors" : [
18101809 {
18111810 "id" : "electricity_consumed_interval" ,
1812- "state" : 0.21 ,
1813- "last_reset" : dt .datetime (2020 , 8 , 3 , 20 , 00 ),
1811+ "state" : [0.21 , dt .datetime (2020 , 8 , 3 , 20 , 00 )],
18141812 }
18151813 ]
18161814 },
0 commit comments