Fix schema for zwave_js WS API (#66052)
parent
c1cb0a0f8e
commit
23d2168952
|
@ -133,6 +133,7 @@ APPLICATION_VERSION = "application_version"
|
|||
MAX_INCLUSION_REQUEST_INTERVAL = "max_inclusion_request_interval"
|
||||
UUID = "uuid"
|
||||
SUPPORTED_PROTOCOLS = "supported_protocols"
|
||||
ADDITIONAL_PROPERTIES = "additional_properties"
|
||||
|
||||
FEATURE = "feature"
|
||||
UNPROVISION = "unprovision"
|
||||
|
@ -170,6 +171,7 @@ def convert_qr_provisioning_information(info: dict) -> QRProvisioningInformation
|
|||
max_inclusion_request_interval=info.get(MAX_INCLUSION_REQUEST_INTERVAL),
|
||||
uuid=info.get(UUID),
|
||||
supported_protocols=protocols if protocols else None,
|
||||
additional_properties=info.get(ADDITIONAL_PROPERTIES, {}),
|
||||
)
|
||||
return info
|
||||
|
||||
|
@ -212,6 +214,7 @@ QR_PROVISIONING_INFORMATION_SCHEMA = vol.All(
|
|||
cv.ensure_list,
|
||||
[vol.Coerce(Protocols)],
|
||||
),
|
||||
vol.Optional(ADDITIONAL_PROPERTIES): dict,
|
||||
}
|
||||
),
|
||||
convert_qr_provisioning_information,
|
||||
|
|
|
@ -29,6 +29,7 @@ from zwave_js_server.model.node import Node
|
|||
|
||||
from homeassistant.components.websocket_api.const import ERR_NOT_FOUND
|
||||
from homeassistant.components.zwave_js.api import (
|
||||
ADDITIONAL_PROPERTIES,
|
||||
APPLICATION_VERSION,
|
||||
CLIENT_SIDE_AUTH,
|
||||
COMMAND_CLASS_ID,
|
||||
|
@ -837,6 +838,7 @@ async def test_provision_smart_start_node(hass, integration, client, hass_ws_cli
|
|||
PRODUCT_TYPE: 1,
|
||||
PRODUCT_ID: 1,
|
||||
APPLICATION_VERSION: "test",
|
||||
ADDITIONAL_PROPERTIES: {"name": "test"},
|
||||
},
|
||||
}
|
||||
)
|
||||
|
@ -861,6 +863,7 @@ async def test_provision_smart_start_node(hass, integration, client, hass_ws_cli
|
|||
max_inclusion_request_interval=None,
|
||||
uuid=None,
|
||||
supported_protocols=None,
|
||||
additional_properties={"name": "test"},
|
||||
).to_dict(),
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue