Support bitmask as a value (#51892)

* Support bitmask as a value

* Fix value schema and add tests

* fix test

* revert change to value schema
This commit is contained in:
Raman Gupta 2021-06-16 15:53:45 -04:00 committed by GitHub
parent 31db3fcb23
commit a250343c55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 228 additions and 16 deletions

View file

@ -51,6 +51,7 @@ from .const import (
EVENT_DEVICE_ADDED_TO_REGISTRY,
)
from .helpers import async_enable_statistics, update_data_collection_preference
from .services import BITMASK_SCHEMA
# general API constants
ID = "id"
@ -925,7 +926,7 @@ async def websocket_refresh_node_cc_values(
vol.Required(NODE_ID): int,
vol.Required(PROPERTY): int,
vol.Optional(PROPERTY_KEY): int,
vol.Required(VALUE): int,
vol.Required(VALUE): vol.Any(int, BITMASK_SCHEMA),
}
)
@websocket_api.async_response