Add usb_path to Z-Wave network_status websocket response (#25617)
* Add usb stick path to zwave network_status websocket response * Move to separate websocket command * Return additional config options * add tests
This commit is contained in:
parent
70dfe42adb
commit
0a87a4bfda
2 changed files with 63 additions and 1 deletions
38
tests/components/zwave/test_websocket_api.py
Normal file
38
tests/components/zwave/test_websocket_api.py
Normal file
|
@ -0,0 +1,38 @@
|
|||
"""Test Z-Wave Websocket API."""
|
||||
from homeassistant.bootstrap import async_setup_component
|
||||
|
||||
from homeassistant.components.zwave.const import (
|
||||
CONF_USB_STICK_PATH,
|
||||
CONF_AUTOHEAL,
|
||||
CONF_POLLING_INTERVAL,
|
||||
)
|
||||
from homeassistant.components.zwave.websocket_api import ID, TYPE
|
||||
|
||||
|
||||
async def test_zwave_ws_api(hass, mock_openzwave, hass_ws_client):
|
||||
"""Test Z-Wave websocket API."""
|
||||
|
||||
await async_setup_component(
|
||||
hass,
|
||||
"zwave",
|
||||
{
|
||||
"zwave": {
|
||||
CONF_AUTOHEAL: False,
|
||||
CONF_USB_STICK_PATH: "/dev/zwave",
|
||||
CONF_POLLING_INTERVAL: 6000,
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
await hass.async_block_till_done()
|
||||
|
||||
client = await hass_ws_client(hass)
|
||||
|
||||
await client.send_json({ID: 5, TYPE: "zwave/get_config"})
|
||||
|
||||
msg = await client.receive_json()
|
||||
result = msg["result"]
|
||||
|
||||
assert result[CONF_USB_STICK_PATH] == "/dev/zwave"
|
||||
assert not result[CONF_AUTOHEAL]
|
||||
assert result[CONF_POLLING_INTERVAL] == 6000
|
Loading…
Add table
Add a link
Reference in a new issue