diff --git a/tests/test_gateway.py b/tests/test_gateway.py index 7a6771ae6..677955e71 100644 --- a/tests/test_gateway.py +++ b/tests/test_gateway.py @@ -25,12 +25,7 @@ zigpy_device_from_json, ) from zha.application import Platform -from zha.application.const import ( - CONF_USE_THREAD, - ZHA_GW_MSG, - ZHA_GW_MSG_CONNECTION_LOST, - RadioType, -) +from zha.application.const import ZHA_GW_MSG, ZHA_GW_MSG_CONNECTION_LOST, RadioType from zha.application.gateway import ( ConnectionLostEvent, DeviceJoinedDeviceInfo, @@ -437,46 +432,6 @@ async def test_remove_device_cleans_up_group_membership( assert device_light_1.ieee not in zha_gateway.devices -@patch( - "zha.application.gateway.Gateway.load_devices", - AsyncMock(), -) -@patch( - "zha.application.gateway.Gateway.load_groups", - MagicMock(), -) -@pytest.mark.parametrize( - ("device_path", "thread_state", "config_override"), - [ - ("/dev/ttyUSB0", True, {}), - ("socket://192.168.1.123:9999", False, {}), - ("socket://192.168.1.123:9999", True, {"use_thread": True}), - ], -) -async def test_gateway_initialize_bellows_thread( - device_path: str, - thread_state: bool, - config_override: dict, - zigpy_app_controller: ControllerApplication, - zha_data: ZHAData, -) -> None: - """Test ZHA disabling the UART thread when connecting to a TCP coordinator.""" - zha_data.config.coordinator_configuration.path = device_path - zha_data.zigpy_config = config_override - - with patch( - "bellows.zigbee.application.ControllerApplication.new", - return_value=zigpy_app_controller, - ) as mock_new: - zha_gw = Gateway(zha_data) - await zha_gw.async_initialize() - assert ( - mock_new.mock_calls[-1].kwargs["config"].get(CONF_USE_THREAD, True) - is thread_state - ) - await zha_gw.shutdown() - - @pytest.mark.parametrize("radio_concurrency", [1, 2, 8]) async def test_startup_concurrency_limit( radio_concurrency: int, diff --git a/zha/application/gateway.py b/zha/application/gateway.py index d6bff81a8..8761fb843 100644 --- a/zha/application/gateway.py +++ b/zha/application/gateway.py @@ -33,7 +33,6 @@ from zha.application import discovery from zha.application.const import ( - CONF_USE_THREAD, UNKNOWN_MANUFACTURER, UNKNOWN_MODEL, ZHA_GW_MSG, @@ -216,15 +215,6 @@ def get_application_controller_data(self) -> tuple[ControllerApplication, dict]: if CONF_NWK_VALIDATE_SETTINGS not in app_config: app_config[CONF_NWK_VALIDATE_SETTINGS] = True - # The bellows UART thread sometimes propagates a cancellation into the main Core - # event loop, when a connection to a TCP coordinator fails in a specific way - if ( - CONF_USE_THREAD not in app_config - and self.radio_type is RadioType.ezsp - and app_config[CONF_DEVICE][CONF_DEVICE_PATH].startswith("socket://") - ): - app_config[CONF_USE_THREAD] = False - return self.radio_type.controller, app_config @classmethod