@@ -365,14 +365,19 @@ def show_setup(location_list, device_list):
365365 _LOGGER .info (" ! no devices found in this location" )
366366
367367 @pytest .mark .asyncio
368- async def device_test (self , smile = pw_smile .Smile , testdata = None ):
368+ async def device_test (self , smile = pw_smile .Smile , testdata = None , preset = False ):
369369 """Perform basic device tests."""
370370 _LOGGER .info ("Asserting testdata:" )
371371 bsw_list = ["binary_sensors" , "sensors" , "switches" ]
372372 smile .get_all_devices ()
373+ # Preset smile.cooling_active for testing of a state-change
374+ smile .cooling_active = False
375+ if preset :
376+ smile .cooling_active = True
373377 data = await smile .async_update ()
374378 extra = data [0 ]
375379 device_list = data [1 ]
380+
376381 self .active_device_present = extra ["active_device" ]
377382 self .cooling_present = extra ["cooling_present" ]
378383 self .notifications = extra ["notifications" ]
@@ -1085,6 +1090,7 @@ async def test_connect_adam_plus_anna_new(self):
10851090 "ee62cad889f94e8ca3d09021f03a660b" : {"control_state" : "off" },
10861091 # Central
10871092 "2743216f626f43948deec1f7ab3b3d70" : {
1093+ "cooling_active" : False ,
10881094 "binary_sensors" : [{"id" : "dhw_state" , "state" : True }],
10891095 "sensors" : [{"id" : "device_state" , "state" : "dhw-heating" }],
10901096 },
@@ -1108,7 +1114,6 @@ async def test_connect_adam_plus_anna_new(self):
11081114 _LOGGER .info (" # Assert master thermostat" )
11091115 assert not smile ._sm_thermostat
11101116 assert self .active_device_present
1111- assert not self .cooling_present
11121117
11131118 switch_change = await self .tinker_switch (
11141119 smile ,
@@ -1473,7 +1478,7 @@ async def test_connect_p1v3(self):
14731478
14741479 await self .device_test (smile , testdata )
14751480 assert smile ._sm_thermostat is None # it's not a thermostat :)
1476- assert self .cooling_present is None # not a heating/cooling system
1481+ assert not self .cooling_present
14771482 assert not self .notifications
14781483
14791484 await smile .close_connection ()
@@ -1565,9 +1570,14 @@ async def test_connect_anna_heatpump(self):
15651570 "3cb70739631c4d17a86b8b12e8a5161b" : {
15661571 "selected_schedule" : "standaard" ,
15671572 "active_preset" : "home" ,
1568- "sensors" : [{"id" : "illuminance" , "state" : 86.0 }],
1573+ "cooling_active" : False ,
1574+ "sensors" : [
1575+ {"id" : "illuminance" , "state" : 86.0 },
1576+ {"id" : "cooling_activation_outdoor_temperature" , "state" : 21.0 },
1577+ {"id" : "cooling_deactivation_threshold" , "state" : 4 },
1578+ ],
15691579 },
1570- # Central
1580+ # Heater central
15711581 "1cbf783bb11e4a7c8a6843dee3a86927" : {
15721582 "cooling_state" : False ,
15731583 "heating_state" : True ,
@@ -1578,10 +1588,12 @@ async def test_connect_anna_heatpump(self):
15781588 }
15791589 ],
15801590 "sensors" : [
1591+ {"id" : "outdoor_temperature" , "state" : 18.0 },
15811592 {"id" : "water_temperature" , "state" : 29.1 },
15821593 {"id" : "water_pressure" , "state" : 1.57 },
15831594 ],
15841595 },
1596+ # Gateway
15851597 "015ae9ea3f964e668e490fa39da3870b" : {
15861598 "sensors" : [{"id" : "outdoor_temperature" , "state" : 20.2 }]
15871599 },
@@ -1599,10 +1611,11 @@ async def test_connect_anna_heatpump(self):
15991611 _LOGGER .info (" # Assert no legacy" )
16001612 assert not smile ._smile_legacy # pylint: disable=protected-access
16011613
1602- await self .device_test (smile , testdata )
1614+ await self .device_test (smile , testdata , True )
16031615 _LOGGER .info (" # Assert master thermostat" )
16041616 assert smile ._sm_thermostat
16051617 assert self .active_device_present
1618+ assert self .cooling_present
16061619 assert not self .notifications
16071620
16081621 await smile .close_connection ()
@@ -1617,7 +1630,12 @@ async def test_connect_anna_heatpump_cooling(self):
16171630 "3cb70739631c4d17a86b8b12e8a5161b" : {
16181631 "selected_schedule" : None ,
16191632 "active_preset" : "home" ,
1620- "sensors" : [{"id" : "illuminance" , "state" : 25.5 }],
1633+ "cooling_active" : True ,
1634+ "sensors" : [
1635+ {"id" : "illuminance" , "state" : 25.5 },
1636+ {"id" : "cooling_activation_outdoor_temperature" , "state" : 21.0 },
1637+ {"id" : "cooling_deactivation_threshold" , "state" : 6 },
1638+ ],
16211639 },
16221640 # Central
16231641 "1cbf783bb11e4a7c8a6843dee3a86927" : {
@@ -1655,6 +1673,7 @@ async def test_connect_anna_heatpump_cooling(self):
16551673 _LOGGER .info (" # Assert master thermostat" )
16561674 assert smile ._sm_thermostat
16571675 assert self .active_device_present
1676+ assert self .cooling_present
16581677 assert not self .notifications
16591678
16601679 await smile .close_connection ()
0 commit comments