mirror of
https://github.com/home-assistant/core.git
synced 2025-09-08 22:31:32 +02:00
Update knx-frontend to 2025.8.24.205840 (#151118)
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
"requirements": [
|
||||
"xknx==3.8.0",
|
||||
"xknxproject==3.8.2",
|
||||
"knx-frontend==2025.8.21.181525"
|
||||
"knx-frontend==2025.8.24.205840"
|
||||
],
|
||||
"single_config_entry": true
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.typing import UNDEFINED
|
||||
from homeassistant.util.ulid import ulid_now
|
||||
|
||||
from .const import DOMAIN, KNX_MODULE_KEY
|
||||
from .const import DOMAIN, KNX_MODULE_KEY, SUPPORTED_PLATFORMS_UI
|
||||
from .storage.config_store import ConfigStoreException
|
||||
from .storage.const import CONF_DATA
|
||||
from .storage.entity_store_schema import (
|
||||
@@ -44,7 +44,7 @@ URL_BASE: Final = "/knx_static"
|
||||
|
||||
async def register_panel(hass: HomeAssistant) -> None:
|
||||
"""Register the KNX Panel and Websocket API."""
|
||||
websocket_api.async_register_command(hass, ws_info)
|
||||
websocket_api.async_register_command(hass, ws_get_base_data)
|
||||
websocket_api.async_register_command(hass, ws_project_file_process)
|
||||
websocket_api.async_register_command(hass, ws_project_file_remove)
|
||||
websocket_api.async_register_command(hass, ws_group_monitor_info)
|
||||
@@ -156,12 +156,12 @@ def provide_knx(
|
||||
@websocket_api.require_admin
|
||||
@websocket_api.websocket_command(
|
||||
{
|
||||
vol.Required("type"): "knx/info",
|
||||
vol.Required("type"): "knx/get_base_data",
|
||||
}
|
||||
)
|
||||
@provide_knx
|
||||
@callback
|
||||
def ws_info(
|
||||
def ws_get_base_data(
|
||||
hass: HomeAssistant,
|
||||
knx: KNXModule,
|
||||
connection: websocket_api.ActiveConnection,
|
||||
@@ -176,14 +176,18 @@ def ws_info(
|
||||
"tool_version": project_info["tool_version"],
|
||||
"xknxproject_version": project_info["xknxproject_version"],
|
||||
}
|
||||
connection_info = {
|
||||
"version": knx.xknx.version,
|
||||
"connected": knx.xknx.connection_manager.connected.is_set(),
|
||||
"current_address": str(knx.xknx.current_address),
|
||||
}
|
||||
|
||||
connection.send_result(
|
||||
msg["id"],
|
||||
{
|
||||
"version": knx.xknx.version,
|
||||
"connected": knx.xknx.connection_manager.connected.is_set(),
|
||||
"current_address": str(knx.xknx.current_address),
|
||||
"project": _project_info,
|
||||
"connection_info": connection_info,
|
||||
"project_info": _project_info,
|
||||
"supported_platforms": sorted(SUPPORTED_PLATFORMS_UI),
|
||||
},
|
||||
)
|
||||
|
||||
@@ -206,10 +210,7 @@ async def ws_get_knx_project(
|
||||
knxproject = await knx.project.get_knxproject()
|
||||
connection.send_result(
|
||||
msg["id"],
|
||||
{
|
||||
"project_loaded": knx.project.loaded,
|
||||
"knxproject": knxproject,
|
||||
},
|
||||
knxproject,
|
||||
)
|
||||
|
||||
|
||||
|
2
requirements_all.txt
generated
2
requirements_all.txt
generated
@@ -1307,7 +1307,7 @@ kiwiki-client==0.1.1
|
||||
knocki==0.4.2
|
||||
|
||||
# homeassistant.components.knx
|
||||
knx-frontend==2025.8.21.181525
|
||||
knx-frontend==2025.8.24.205840
|
||||
|
||||
# homeassistant.components.konnected
|
||||
konnected==1.2.0
|
||||
|
2
requirements_test_all.txt
generated
2
requirements_test_all.txt
generated
@@ -1129,7 +1129,7 @@ kegtron-ble==0.4.0
|
||||
knocki==0.4.2
|
||||
|
||||
# homeassistant.components.knx
|
||||
knx-frontend==2025.8.21.181525
|
||||
knx-frontend==2025.8.24.205840
|
||||
|
||||
# homeassistant.components.konnected
|
||||
konnected==1.2.0
|
||||
|
@@ -21,42 +21,47 @@ from .conftest import KNXTestKit
|
||||
from tests.typing import WebSocketGenerator
|
||||
|
||||
|
||||
async def test_knx_info_command(
|
||||
async def test_knx_get_base_data_command(
|
||||
hass: HomeAssistant, knx: KNXTestKit, hass_ws_client: WebSocketGenerator
|
||||
) -> None:
|
||||
"""Test knx/info command."""
|
||||
"""Test knx/get_base_data command."""
|
||||
await knx.setup_integration()
|
||||
client = await hass_ws_client(hass)
|
||||
await client.send_json_auto_id({"type": "knx/info"})
|
||||
await client.send_json_auto_id({"type": "knx/get_base_data"})
|
||||
|
||||
res = await client.receive_json()
|
||||
assert res["success"], res
|
||||
assert res["result"]["version"] is not None
|
||||
assert res["result"]["connected"]
|
||||
assert res["result"]["current_address"] == "0.0.0"
|
||||
assert res["result"]["project"] is None
|
||||
assert res["result"]["connection_info"]["version"] is not None
|
||||
assert res["result"]["connection_info"]["connected"]
|
||||
assert res["result"]["connection_info"]["current_address"] == "0.0.0"
|
||||
assert res["result"]["project_info"] is None
|
||||
assert not SUPPORTED_PLATFORMS_UI.difference(res["result"]["supported_platforms"])
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("load_knxproj")
|
||||
async def test_knx_info_command_with_project(
|
||||
async def test_knx_get_base_data_command_with_project(
|
||||
hass: HomeAssistant,
|
||||
knx: KNXTestKit,
|
||||
hass_ws_client: WebSocketGenerator,
|
||||
) -> None:
|
||||
"""Test knx/info command with loaded project."""
|
||||
"""Test knx/get_base_data command with loaded project."""
|
||||
await knx.setup_integration()
|
||||
client = await hass_ws_client(hass)
|
||||
await client.send_json_auto_id({"type": "knx/info"})
|
||||
await client.send_json_auto_id({"type": "knx/get_base_data"})
|
||||
|
||||
res = await client.receive_json()
|
||||
assert res["success"], res
|
||||
assert res["result"]["version"] is not None
|
||||
assert res["result"]["connected"]
|
||||
assert res["result"]["current_address"] == "0.0.0"
|
||||
assert res["result"]["project"] is not None
|
||||
assert res["result"]["project"]["name"] == "Fixture"
|
||||
assert res["result"]["project"]["last_modified"] == "2023-04-30T09:04:04.4043671Z"
|
||||
assert res["result"]["project"]["tool_version"] == "5.7.1428.39779"
|
||||
|
||||
connection_info = res["result"]["connection_info"]
|
||||
assert connection_info["version"] is not None
|
||||
assert connection_info["connected"]
|
||||
assert connection_info["current_address"] == "0.0.0"
|
||||
|
||||
project_info = res["result"]["project_info"]
|
||||
assert project_info is not None
|
||||
assert project_info["name"] == "Fixture"
|
||||
assert project_info["last_modified"] == "2023-04-30T09:04:04.4043671Z"
|
||||
assert project_info["tool_version"] == "5.7.1428.39779"
|
||||
|
||||
|
||||
async def test_knx_project_file_process(
|
||||
@@ -165,8 +170,24 @@ async def test_knx_get_project(
|
||||
await client.send_json_auto_id({"type": "knx/get_knx_project"})
|
||||
res = await client.receive_json()
|
||||
assert res["success"], res
|
||||
assert res["result"]["project_loaded"] is True
|
||||
assert res["result"]["knxproject"] == project_data
|
||||
assert res["result"] == project_data
|
||||
|
||||
|
||||
async def test_knx_get_project_no_project(
|
||||
hass: HomeAssistant,
|
||||
knx: KNXTestKit,
|
||||
hass_ws_client: WebSocketGenerator,
|
||||
project_data: dict[str, Any],
|
||||
) -> None:
|
||||
"""Test retrieval of kxnproject from store."""
|
||||
await knx.setup_integration()
|
||||
client = await hass_ws_client(hass)
|
||||
assert not hass.data[KNX_MODULE_KEY].project.loaded
|
||||
|
||||
await client.send_json_auto_id({"type": "knx/get_knx_project"})
|
||||
res = await client.receive_json()
|
||||
assert res["success"], res
|
||||
assert res["result"] is None
|
||||
|
||||
|
||||
async def test_knx_group_monitor_info_command(
|
||||
@@ -414,7 +435,7 @@ async def test_knx_get_schema(
|
||||
@pytest.mark.parametrize(
|
||||
"endpoint",
|
||||
[
|
||||
"knx/info", # sync ws-command
|
||||
"knx/get_base_data", # sync ws-command
|
||||
"knx/get_knx_project", # async ws-command
|
||||
],
|
||||
)
|
||||
|
Reference in New Issue
Block a user