@@ -128,6 +128,26 @@ async def mock_install_firmware_step(
128128 assert zha_flow ["context" ]["source" ] == "hardware"
129129 assert zha_flow ["step_id" ] == "confirm"
130130
131+ progress_zha_flows = hass .config_entries .flow ._async_progress_by_handler (
132+ handler = "zha" ,
133+ match_context = None ,
134+ )
135+
136+ assert len (progress_zha_flows ) == 1
137+
138+ # Ensure correct baudrate
139+ progress_zha_flow = progress_zha_flows [0 ]
140+ assert progress_zha_flow .init_data == {
141+ "flow_strategy" : "recommended" ,
142+ "name" : model ,
143+ "port" : {
144+ "path" : usb_data .device ,
145+ "baudrate" : 460800 ,
146+ "flow_control" : "hardware" ,
147+ },
148+ "radio_type" : fw_type .value ,
149+ }
150+
131151
132152@pytest .mark .usefixtures ("addon_installed" , "supervisor" )
133153async def test_config_flow_thread (
@@ -335,6 +355,35 @@ async def test_options_flow(
335355 assert flash_mock .call_count == 1
336356 assert flash_mock .mock_calls [0 ].kwargs ["bootloader_reset_methods" ] == ["rts_dtr" ]
337357
358+ flows = hass .config_entries .flow .async_progress ()
359+
360+ # Ensure a ZHA discovery flow has been created
361+ assert len (flows ) == 1
362+ zha_flow = flows [0 ]
363+ assert zha_flow ["handler" ] == "zha"
364+ assert zha_flow ["context" ]["source" ] == "hardware"
365+ assert zha_flow ["step_id" ] == "confirm"
366+
367+ progress_zha_flows = hass .config_entries .flow ._async_progress_by_handler (
368+ handler = "zha" ,
369+ match_context = None ,
370+ )
371+
372+ assert len (progress_zha_flows ) == 1
373+
374+ # Ensure correct baudrate
375+ progress_zha_flow = progress_zha_flows [0 ]
376+ assert progress_zha_flow .init_data == {
377+ "flow_strategy" : "recommended" ,
378+ "name" : model ,
379+ "port" : {
380+ "path" : usb_data .device ,
381+ "baudrate" : 460800 ,
382+ "flow_control" : "hardware" ,
383+ },
384+ "radio_type" : "ezsp" ,
385+ }
386+
338387
339388async def test_duplicate_discovery (hass : HomeAssistant ) -> None :
340389 """Test config flow unique_id deduplication."""
0 commit comments