mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
add api to refresh topology (#44840)
This commit is contained in:
parent
a775b79d4b
commit
51e695fd45
@ -469,6 +469,19 @@ async def websocket_reconfigure_node(hass, connection, msg):
|
|||||||
hass.async_create_task(device.async_configure())
|
hass.async_create_task(device.async_configure())
|
||||||
|
|
||||||
|
|
||||||
|
@websocket_api.require_admin
|
||||||
|
@websocket_api.async_response
|
||||||
|
@websocket_api.websocket_command(
|
||||||
|
{
|
||||||
|
vol.Required(TYPE): "zha/topology/update",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
async def websocket_update_topology(hass, connection, msg):
|
||||||
|
"""Update the ZHA network topology."""
|
||||||
|
zha_gateway = hass.data[DATA_ZHA][DATA_ZHA_GATEWAY]
|
||||||
|
hass.async_create_task(zha_gateway.application_controller.topology.scan())
|
||||||
|
|
||||||
|
|
||||||
@websocket_api.require_admin
|
@websocket_api.require_admin
|
||||||
@websocket_api.async_response
|
@websocket_api.async_response
|
||||||
@websocket_api.websocket_command(
|
@websocket_api.websocket_command(
|
||||||
@ -1143,6 +1156,7 @@ def async_load_api(hass):
|
|||||||
websocket_api.async_register_command(hass, websocket_get_bindable_devices)
|
websocket_api.async_register_command(hass, websocket_get_bindable_devices)
|
||||||
websocket_api.async_register_command(hass, websocket_bind_devices)
|
websocket_api.async_register_command(hass, websocket_bind_devices)
|
||||||
websocket_api.async_register_command(hass, websocket_unbind_devices)
|
websocket_api.async_register_command(hass, websocket_unbind_devices)
|
||||||
|
websocket_api.async_register_command(hass, websocket_update_topology)
|
||||||
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
|
Loading…
x
Reference in New Issue
Block a user