Add Z-Wave WS command to hard reset controller (#101449)
This commit is contained in:
parent
d46dca8950
commit
70a0cd579d
2 changed files with 93 additions and 0 deletions
|
@ -447,6 +447,7 @@ def async_register_api(hass: HomeAssistant) -> None:
|
|||
hass, websocket_subscribe_controller_statistics
|
||||
)
|
||||
websocket_api.async_register_command(hass, websocket_subscribe_node_statistics)
|
||||
websocket_api.async_register_command(hass, websocket_hard_reset_controller)
|
||||
hass.http.register_view(FirmwareUploadView(dr.async_get(hass)))
|
||||
|
||||
|
||||
|
@ -2441,3 +2442,26 @@ async def websocket_subscribe_node_statistics(
|
|||
},
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@websocket_api.require_admin
|
||||
@websocket_api.websocket_command(
|
||||
{
|
||||
vol.Required(TYPE): "zwave_js/hard_reset_controller",
|
||||
vol.Required(ENTRY_ID): str,
|
||||
}
|
||||
)
|
||||
@websocket_api.async_response
|
||||
@async_handle_failed_command
|
||||
@async_get_entry
|
||||
async def websocket_hard_reset_controller(
|
||||
hass: HomeAssistant,
|
||||
connection: ActiveConnection,
|
||||
msg: dict[str, Any],
|
||||
entry: ConfigEntry,
|
||||
client: Client,
|
||||
driver: Driver,
|
||||
) -> None:
|
||||
"""Hard reset controller."""
|
||||
await driver.async_hard_reset()
|
||||
connection.send_result(msg[ID])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue