@@ -2199,15 +2199,17 @@ async def test_manually_idle_notification_value(
21992199 await node .async_manually_idle_notification_value (f"{ node .node_id } -112-0-255" )
22002200
22012201
2202- async def test_set_date_and_time (multisensor_6 : node_pkg .Node , uuid4 , mock_command ):
2203- """Test node.set_date_and_time command."""
2202+ async def test_set_date_and_time_no_wait (
2203+ multisensor_6 : node_pkg .Node , uuid4 , mock_command
2204+ ):
2205+ """Test node.set_date_and_time command without waiting."""
22042206 node = multisensor_6
22052207 ack_commands = mock_command (
22062208 {"command" : "node.set_date_and_time" , "nodeId" : node .node_id },
22072209 {"success" : True },
22082210 )
22092211
2210- assert await node .async_set_date_and_time (datetime (2020 , 1 , 1 , 12 , 0 , 0 ))
2212+ assert await node .async_set_date_and_time (datetime (2020 , 1 , 1 , 12 , 0 , 0 )) is None
22112213
22122214 assert len (ack_commands ) == 1
22132215 assert ack_commands [0 ] == {
@@ -2217,9 +2219,26 @@ async def test_set_date_and_time(multisensor_6: node_pkg.Node, uuid4, mock_comma
22172219 "messageId" : uuid4 ,
22182220 }
22192221
2220- # Raise ValueError if the value is not for the right CommandClass
2221- with pytest .raises (ValueError ):
2222- await node .async_manually_idle_notification_value (f"{ node .node_id } -112-0-255" )
2222+
2223+ async def test_set_date_and_time (
2224+ climate_radio_thermostat_ct100_plus : node_pkg .Node , uuid4 , mock_command
2225+ ):
2226+ """Test node.set_date_and_time command while waiting for response."""
2227+ node = climate_radio_thermostat_ct100_plus
2228+ ack_commands = mock_command (
2229+ {"command" : "node.set_date_and_time" , "nodeId" : node .node_id },
2230+ {"success" : True },
2231+ )
2232+
2233+ assert await node .async_set_date_and_time (datetime (2020 , 1 , 1 , 12 , 0 , 0 ))
2234+
2235+ assert len (ack_commands ) == 1
2236+ assert ack_commands [0 ] == {
2237+ "command" : "node.set_date_and_time" ,
2238+ "nodeId" : node .node_id ,
2239+ "date" : "2020-01-01T12:00:00" ,
2240+ "messageId" : uuid4 ,
2241+ }
22232242
22242243
22252244async def test_get_date_and_time (multisensor_6 : node_pkg .Node , uuid4 , mock_command ):
0 commit comments