Skip to content

Commit c2e2556

Browse files
committed
Add testdata_updated assert, assert device-items
1 parent beecfd0 commit c2e2556

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

tests/test_smile.py

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3942,6 +3942,40 @@ async def test_connect_anna_heatpump_heating(self):
39423942
},
39433943
},
39443944
}
3945+
testdata_updated = {
3946+
"1cbf783bb11e4a7c8a6843dee3a86927": {
3947+
"dev_class": "heater_central",
3948+
"location": "a57efe5f145f498c9be62a9b63626fbf",
3949+
"model": "Generic heater",
3950+
"name": "OpenTherm",
3951+
"vendor": "Techneco",
3952+
"maximum_boiler_temperature": {
3953+
"setpoint": 60.0,
3954+
"lower_bound": 0.0,
3955+
"upper_bound": 100.0,
3956+
"resolution": 1.0,
3957+
},
3958+
"available": True,
3959+
"binary_sensors": {
3960+
"dhw_state": False,
3961+
"heating_state": True,
3962+
"compressor_state": True,
3963+
"cooling_enabled": False,
3964+
"slave_boiler_state": False,
3965+
"flame_state": False,
3966+
},
3967+
"sensors": {
3968+
"water_temperature": 29.1,
3969+
"dhw_temperature": 46.3,
3970+
"intended_boiler_temperature": 35.0,
3971+
"modulation_level": 52,
3972+
"return_temperature": 25.1,
3973+
"water_pressure": 1.57,
3974+
"outdoor_air_temperature": 3.0,
3975+
},
3976+
"switches": {"dhw_cm_switch": False},
3977+
},
3978+
}
39453979

39463980
self.smile_setup = "anna_heatpump_heating"
39473981
server, smile, client = await self.connect_wrapper()
@@ -3974,9 +4008,11 @@ async def test_connect_anna_heatpump_heating(self):
39744008
assert result
39754009

39764010
# Now change some data and change directory reading xml from
3977-
# emulating reading newer dataset after an update_interval
4011+
# emulating reading newer dataset after an update_interval,
4012+
# set testday to Monday to force an incremental update
39784013
self.smile_setup = "updated/anna_heatpump_heating"
3979-
await self.device_test(smile, "2020-04-13 00:00:01", testdata, initialize=False)
4014+
await self.device_test(smile, "2020-04-13 00:00:01", testdata_updated, initialize=False)
4015+
assert self.device_items == 64
39804016
await smile.close_connection()
39814017
await self.disconnect(server, client)
39824018

0 commit comments

Comments
 (0)