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