@@ -23,9 +23,10 @@ async def test_set_dhw_time_program(mock_bsblan: BSBLAN) -> None:
2323 """
2424 # Test setting time program for Monday
2525 assert isinstance (mock_bsblan ._request , AsyncMock )
26- await mock_bsblan . set_hot_water (
27- dhw_time_program_monday = "13:00-14:00 ##:##-##:## ##:##-##:##"
26+ dhw_programs = DHWTimeSwitchPrograms (
27+ monday = "13:00-14:00 ##:##-##:## ##:##-##:##"
2828 )
29+ await mock_bsblan .set_hot_water (dhw_time_programs = dhw_programs )
2930 mock_bsblan ._request .assert_awaited_with (
3031 base_path = "/JS" ,
3132 data = {
@@ -36,9 +37,10 @@ async def test_set_dhw_time_program(mock_bsblan: BSBLAN) -> None:
3637 )
3738
3839 # Test setting time program for Tuesday
39- await mock_bsblan . set_hot_water (
40- dhw_time_program_tuesday = "06:00-08:00 17:00-20:00 ##:##-##:##"
40+ dhw_programs = DHWTimeSwitchPrograms (
41+ tuesday = "06:00-08:00 17:00-20:00 ##:##-##:##"
4142 )
43+ await mock_bsblan .set_hot_water (dhw_time_programs = dhw_programs )
4244 mock_bsblan ._request .assert_awaited_with (
4345 base_path = "/JS" ,
4446 data = {
@@ -49,9 +51,10 @@ async def test_set_dhw_time_program(mock_bsblan: BSBLAN) -> None:
4951 )
5052
5153 # Test setting time program for Wednesday
52- await mock_bsblan . set_hot_water (
53- dhw_time_program_wednesday = "07:30-09:00 18:00-21:30 ##:##-##:##"
54+ dhw_programs = DHWTimeSwitchPrograms (
55+ wednesday = "07:30-09:00 18:00-21:30 ##:##-##:##"
5456 )
57+ await mock_bsblan .set_hot_water (dhw_time_programs = dhw_programs )
5558 mock_bsblan ._request .assert_awaited_with (
5659 base_path = "/JS" ,
5760 data = {
@@ -62,9 +65,10 @@ async def test_set_dhw_time_program(mock_bsblan: BSBLAN) -> None:
6265 )
6366
6467 # Test setting time program for Thursday
65- await mock_bsblan . set_hot_water (
66- dhw_time_program_thursday = "06:00-09:00 16:00-22:00 ##:##-##:##"
68+ dhw_programs = DHWTimeSwitchPrograms (
69+ thursday = "06:00-09:00 16:00-22:00 ##:##-##:##"
6770 )
71+ await mock_bsblan .set_hot_water (dhw_time_programs = dhw_programs )
6872 mock_bsblan ._request .assert_awaited_with (
6973 base_path = "/JS" ,
7074 data = {
@@ -75,9 +79,10 @@ async def test_set_dhw_time_program(mock_bsblan: BSBLAN) -> None:
7579 )
7680
7781 # Test setting time program for Friday
78- await mock_bsblan . set_hot_water (
79- dhw_time_program_friday = "06:00-09:00 15:00-23:00 ##:##-##:##"
82+ dhw_programs = DHWTimeSwitchPrograms (
83+ friday = "06:00-09:00 15:00-23:00 ##:##-##:##"
8084 )
85+ await mock_bsblan .set_hot_water (dhw_time_programs = dhw_programs )
8186 mock_bsblan ._request .assert_awaited_with (
8287 base_path = "/JS" ,
8388 data = {
@@ -88,9 +93,10 @@ async def test_set_dhw_time_program(mock_bsblan: BSBLAN) -> None:
8893 )
8994
9095 # Test setting time program for Saturday
91- await mock_bsblan . set_hot_water (
92- dhw_time_program_saturday = "08:00-23:00 ##:##-##:## ##:##-##:##"
96+ dhw_programs = DHWTimeSwitchPrograms (
97+ saturday = "08:00-23:00 ##:##-##:## ##:##-##:##"
9398 )
99+ await mock_bsblan .set_hot_water (dhw_time_programs = dhw_programs )
94100 mock_bsblan ._request .assert_awaited_with (
95101 base_path = "/JS" ,
96102 data = {
@@ -101,9 +107,10 @@ async def test_set_dhw_time_program(mock_bsblan: BSBLAN) -> None:
101107 )
102108
103109 # Test setting time program for Sunday
104- await mock_bsblan . set_hot_water (
105- dhw_time_program_sunday = "08:00-22:00 ##:##-##:## ##:##-##:##"
110+ dhw_programs = DHWTimeSwitchPrograms (
111+ sunday = "08:00-22:00 ##:##-##:## ##:##-##:##"
106112 )
113+ await mock_bsblan .set_hot_water (dhw_time_programs = dhw_programs )
107114 mock_bsblan ._request .assert_awaited_with (
108115 base_path = "/JS" ,
109116 data = {
@@ -114,7 +121,8 @@ async def test_set_dhw_time_program(mock_bsblan: BSBLAN) -> None:
114121 )
115122
116123 # Test setting standard values
117- await mock_bsblan .set_hot_water (dhw_time_program_standard_values = "0" )
124+ dhw_programs = DHWTimeSwitchPrograms (standard_values = "0" )
125+ await mock_bsblan .set_hot_water (dhw_time_programs = dhw_programs )
118126 mock_bsblan ._request .assert_awaited_with (
119127 base_path = "/JS" ,
120128 data = {
@@ -125,11 +133,12 @@ async def test_set_dhw_time_program(mock_bsblan: BSBLAN) -> None:
125133 )
126134
127135 # Test setting multiple parameters (should raise an error)
136+ dhw_programs = DHWTimeSwitchPrograms (
137+ monday = "13:00-14:00 ##:##-##:## ##:##-##:##" ,
138+ tuesday = "06:00-08:00 17:00-20:00 ##:##-##:##" ,
139+ )
128140 with pytest .raises (BSBLANError , match = MULTI_PARAMETER_ERROR_MSG ):
129- await mock_bsblan .set_hot_water (
130- dhw_time_program_monday = "13:00-14:00 ##:##-##:## ##:##-##:##" ,
131- dhw_time_program_tuesday = "06:00-08:00 17:00-20:00 ##:##-##:##" ,
132- )
141+ await mock_bsblan .set_hot_water (dhw_time_programs = dhw_programs )
133142
134143
135144@pytest .mark .asyncio
0 commit comments