mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Run KNX protocol logic in a separate thread (#68807)
This commit is contained in:
parent
9881538c27
commit
f2aee38841
@ -394,6 +394,7 @@ class KNXModule:
|
|||||||
connection_type=ConnectionType.ROUTING,
|
connection_type=ConnectionType.ROUTING,
|
||||||
local_ip=self.config.get(ConnectionSchema.CONF_KNX_LOCAL_IP),
|
local_ip=self.config.get(ConnectionSchema.CONF_KNX_LOCAL_IP),
|
||||||
auto_reconnect=True,
|
auto_reconnect=True,
|
||||||
|
threaded=True,
|
||||||
)
|
)
|
||||||
if _conn_type == CONF_KNX_TUNNELING:
|
if _conn_type == CONF_KNX_TUNNELING:
|
||||||
return ConnectionConfig(
|
return ConnectionConfig(
|
||||||
@ -403,6 +404,7 @@ class KNXModule:
|
|||||||
local_ip=self.config.get(ConnectionSchema.CONF_KNX_LOCAL_IP),
|
local_ip=self.config.get(ConnectionSchema.CONF_KNX_LOCAL_IP),
|
||||||
route_back=self.config.get(ConnectionSchema.CONF_KNX_ROUTE_BACK, False),
|
route_back=self.config.get(ConnectionSchema.CONF_KNX_ROUTE_BACK, False),
|
||||||
auto_reconnect=True,
|
auto_reconnect=True,
|
||||||
|
threaded=True,
|
||||||
)
|
)
|
||||||
if _conn_type == CONF_KNX_TUNNELING_TCP:
|
if _conn_type == CONF_KNX_TUNNELING_TCP:
|
||||||
return ConnectionConfig(
|
return ConnectionConfig(
|
||||||
@ -410,8 +412,12 @@ class KNXModule:
|
|||||||
gateway_ip=self.config[CONF_HOST],
|
gateway_ip=self.config[CONF_HOST],
|
||||||
gateway_port=self.config[CONF_PORT],
|
gateway_port=self.config[CONF_PORT],
|
||||||
auto_reconnect=True,
|
auto_reconnect=True,
|
||||||
|
threaded=True,
|
||||||
|
)
|
||||||
|
return ConnectionConfig(
|
||||||
|
auto_reconnect=True,
|
||||||
|
threaded=True,
|
||||||
)
|
)
|
||||||
return ConnectionConfig(auto_reconnect=True)
|
|
||||||
|
|
||||||
async def connection_state_changed_cb(self, state: XknxConnectionState) -> None:
|
async def connection_state_changed_cb(self, state: XknxConnectionState) -> None:
|
||||||
"""Call invoked after a KNX connection state change was received."""
|
"""Call invoked after a KNX connection state change was received."""
|
||||||
|
@ -28,7 +28,7 @@ from tests.common import MockConfigEntry
|
|||||||
CONF_KNX_INDIVIDUAL_ADDRESS: XKNX.DEFAULT_ADDRESS,
|
CONF_KNX_INDIVIDUAL_ADDRESS: XKNX.DEFAULT_ADDRESS,
|
||||||
CONF_KNX_CONNECTION_TYPE: CONF_KNX_AUTOMATIC,
|
CONF_KNX_CONNECTION_TYPE: CONF_KNX_AUTOMATIC,
|
||||||
},
|
},
|
||||||
ConnectionConfig(),
|
ConnectionConfig(threaded=True),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
{
|
{
|
||||||
@ -36,7 +36,9 @@ from tests.common import MockConfigEntry
|
|||||||
ConnectionSchema.CONF_KNX_LOCAL_IP: "192.168.1.1",
|
ConnectionSchema.CONF_KNX_LOCAL_IP: "192.168.1.1",
|
||||||
},
|
},
|
||||||
ConnectionConfig(
|
ConnectionConfig(
|
||||||
connection_type=ConnectionType.ROUTING, local_ip="192.168.1.1"
|
connection_type=ConnectionType.ROUTING,
|
||||||
|
local_ip="192.168.1.1",
|
||||||
|
threaded=True,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
@ -54,6 +56,7 @@ from tests.common import MockConfigEntry
|
|||||||
gateway_port=3675,
|
gateway_port=3675,
|
||||||
local_ip="192.168.1.112",
|
local_ip="192.168.1.112",
|
||||||
auto_reconnect=True,
|
auto_reconnect=True,
|
||||||
|
threaded=True,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user