Fix schema for zwave_js WS API (#66052)
This commit is contained in:
parent
895aee3fb2
commit
4076ca9641
2 changed files with 6 additions and 0 deletions
|
@ -133,6 +133,7 @@ APPLICATION_VERSION = "application_version"
|
||||||
MAX_INCLUSION_REQUEST_INTERVAL = "max_inclusion_request_interval"
|
MAX_INCLUSION_REQUEST_INTERVAL = "max_inclusion_request_interval"
|
||||||
UUID = "uuid"
|
UUID = "uuid"
|
||||||
SUPPORTED_PROTOCOLS = "supported_protocols"
|
SUPPORTED_PROTOCOLS = "supported_protocols"
|
||||||
|
ADDITIONAL_PROPERTIES = "additional_properties"
|
||||||
|
|
||||||
FEATURE = "feature"
|
FEATURE = "feature"
|
||||||
UNPROVISION = "unprovision"
|
UNPROVISION = "unprovision"
|
||||||
|
@ -170,6 +171,7 @@ def convert_qr_provisioning_information(info: dict) -> QRProvisioningInformation
|
||||||
max_inclusion_request_interval=info.get(MAX_INCLUSION_REQUEST_INTERVAL),
|
max_inclusion_request_interval=info.get(MAX_INCLUSION_REQUEST_INTERVAL),
|
||||||
uuid=info.get(UUID),
|
uuid=info.get(UUID),
|
||||||
supported_protocols=protocols if protocols else None,
|
supported_protocols=protocols if protocols else None,
|
||||||
|
additional_properties=info.get(ADDITIONAL_PROPERTIES, {}),
|
||||||
)
|
)
|
||||||
return info
|
return info
|
||||||
|
|
||||||
|
@ -212,6 +214,7 @@ QR_PROVISIONING_INFORMATION_SCHEMA = vol.All(
|
||||||
cv.ensure_list,
|
cv.ensure_list,
|
||||||
[vol.Coerce(Protocols)],
|
[vol.Coerce(Protocols)],
|
||||||
),
|
),
|
||||||
|
vol.Optional(ADDITIONAL_PROPERTIES): dict,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
convert_qr_provisioning_information,
|
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.websocket_api.const import ERR_NOT_FOUND
|
||||||
from homeassistant.components.zwave_js.api import (
|
from homeassistant.components.zwave_js.api import (
|
||||||
|
ADDITIONAL_PROPERTIES,
|
||||||
APPLICATION_VERSION,
|
APPLICATION_VERSION,
|
||||||
CLIENT_SIDE_AUTH,
|
CLIENT_SIDE_AUTH,
|
||||||
COMMAND_CLASS_ID,
|
COMMAND_CLASS_ID,
|
||||||
|
@ -837,6 +838,7 @@ async def test_provision_smart_start_node(hass, integration, client, hass_ws_cli
|
||||||
PRODUCT_TYPE: 1,
|
PRODUCT_TYPE: 1,
|
||||||
PRODUCT_ID: 1,
|
PRODUCT_ID: 1,
|
||||||
APPLICATION_VERSION: "test",
|
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,
|
max_inclusion_request_interval=None,
|
||||||
uuid=None,
|
uuid=None,
|
||||||
supported_protocols=None,
|
supported_protocols=None,
|
||||||
|
additional_properties={"name": "test"},
|
||||||
).to_dict(),
|
).to_dict(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue