mirror of
https://github.com/home-assistant/core.git
synced 2025-07-31 19:25:12 +02:00
Remove bellows thread, as it has been removed upstream
This commit is contained in:
@@ -139,7 +139,6 @@ CONF_ENABLE_IDENTIFY_ON_JOIN = "enable_identify_on_join"
|
||||
CONF_ENABLE_QUIRKS = "enable_quirks"
|
||||
CONF_RADIO_TYPE = "radio_type"
|
||||
CONF_USB_PATH = "usb_path"
|
||||
CONF_USE_THREAD = "use_thread"
|
||||
CONF_ZIGPY = "zigpy_config"
|
||||
|
||||
CONF_CONSIDER_UNAVAILABLE_MAINS = "consider_unavailable_mains"
|
||||
|
@@ -46,7 +46,6 @@ from .const import (
|
||||
ATTR_SIGNATURE,
|
||||
ATTR_TYPE,
|
||||
CONF_RADIO_TYPE,
|
||||
CONF_USE_THREAD,
|
||||
CONF_ZIGPY,
|
||||
DEBUG_COMP_BELLOWS,
|
||||
DEBUG_COMP_ZHA,
|
||||
@@ -158,15 +157,6 @@ class ZHAGateway:
|
||||
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 radio_type is RadioType.ezsp
|
||||
and app_config[CONF_DEVICE][CONF_DEVICE_PATH].startswith("socket://")
|
||||
):
|
||||
app_config[CONF_USE_THREAD] = False
|
||||
|
||||
# Local import to avoid circular dependencies
|
||||
# pylint: disable-next=import-outside-toplevel
|
||||
from homeassistant.components.homeassistant_hardware.silabs_multiprotocol_addon import (
|
||||
|
@@ -10,7 +10,6 @@ import logging
|
||||
import os
|
||||
from typing import Any, Self
|
||||
|
||||
from bellows.config import CONF_USE_THREAD
|
||||
import voluptuous as vol
|
||||
from zigpy.application import ControllerApplication
|
||||
import zigpy.backups
|
||||
@@ -175,7 +174,6 @@ class ZhaRadioManager:
|
||||
app_config[CONF_DATABASE] = database_path
|
||||
app_config[CONF_DEVICE] = self.device_settings
|
||||
app_config[CONF_NWK_BACKUP_ENABLED] = False
|
||||
app_config[CONF_USE_THREAD] = False
|
||||
app_config = self.radio_type.controller.SCHEMA(app_config)
|
||||
|
||||
app = await self.radio_type.controller.new(
|
||||
|
@@ -1,9 +1,8 @@
|
||||
"""Test ZHA Gateway."""
|
||||
import asyncio
|
||||
from unittest.mock import MagicMock, patch
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from zigpy.application import ControllerApplication
|
||||
import zigpy.profiles.zha as zha
|
||||
import zigpy.zcl.clusters.general as general
|
||||
import zigpy.zcl.clusters.lighting as lighting
|
||||
@@ -223,48 +222,6 @@ async def test_gateway_create_group_with_id(
|
||||
assert zha_group.group_id == 0x1234
|
||||
|
||||
|
||||
@patch(
|
||||
"homeassistant.components.zha.core.gateway.ZHAGateway.async_load_devices",
|
||||
MagicMock(),
|
||||
)
|
||||
@patch(
|
||||
"homeassistant.components.zha.core.gateway.ZHAGateway.async_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,
|
||||
hass: HomeAssistant,
|
||||
zigpy_app_controller: ControllerApplication,
|
||||
config_entry: MockConfigEntry,
|
||||
) -> None:
|
||||
"""Test ZHA disabling the UART thread when connecting to a TCP coordinator."""
|
||||
config_entry.data = dict(config_entry.data)
|
||||
config_entry.data["device"]["path"] = device_path
|
||||
config_entry.add_to_hass(hass)
|
||||
|
||||
zha_gateway = ZHAGateway(hass, {"zigpy_config": config_override}, config_entry)
|
||||
|
||||
with patch(
|
||||
"bellows.zigbee.application.ControllerApplication.new",
|
||||
return_value=zigpy_app_controller,
|
||||
) as mock_new:
|
||||
await zha_gateway.async_initialize()
|
||||
|
||||
mock_new.mock_calls[-1].kwargs["config"]["use_thread"] is thread_state
|
||||
|
||||
await zha_gateway.shutdown()
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("device_path", "config_override", "expected_channel"),
|
||||
[
|
||||
|
Reference in New Issue
Block a user