mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Only show zwave_js command classes that are on the node (#54794)
This commit is contained in:
parent
a6ac55390a
commit
c1595d5ceb
@ -197,7 +197,10 @@ async def async_get_condition_capabilities(
|
|||||||
"extra_fields": vol.Schema(
|
"extra_fields": vol.Schema(
|
||||||
{
|
{
|
||||||
vol.Required(ATTR_COMMAND_CLASS): vol.In(
|
vol.Required(ATTR_COMMAND_CLASS): vol.In(
|
||||||
{cc.value: cc.name for cc in CommandClass}
|
{
|
||||||
|
CommandClass(cc.id).value: CommandClass(cc.id).name
|
||||||
|
for cc in sorted(node.command_classes, key=lambda cc: cc.name) # type: ignore[no-any-return]
|
||||||
|
}
|
||||||
),
|
),
|
||||||
vol.Required(ATTR_PROPERTY): cv.string,
|
vol.Required(ATTR_PROPERTY): cv.string,
|
||||||
vol.Optional(ATTR_PROPERTY_KEY): cv.string,
|
vol.Optional(ATTR_PROPERTY_KEY): cv.string,
|
||||||
|
@ -430,7 +430,18 @@ async def test_get_condition_capabilities_value(
|
|||||||
)
|
)
|
||||||
assert capabilities and "extra_fields" in capabilities
|
assert capabilities and "extra_fields" in capabilities
|
||||||
|
|
||||||
cc_options = [(cc.value, cc.name) for cc in CommandClass]
|
cc_options = [
|
||||||
|
(133, "ASSOCIATION"),
|
||||||
|
(128, "BATTERY"),
|
||||||
|
(112, "CONFIGURATION"),
|
||||||
|
(98, "DOOR_LOCK"),
|
||||||
|
(122, "FIRMWARE_UPDATE_MD"),
|
||||||
|
(114, "MANUFACTURER_SPECIFIC"),
|
||||||
|
(113, "ALARM"),
|
||||||
|
(152, "SECURITY"),
|
||||||
|
(99, "USER_CODE"),
|
||||||
|
(134, "VERSION"),
|
||||||
|
]
|
||||||
|
|
||||||
assert voluptuous_serialize.convert(
|
assert voluptuous_serialize.convert(
|
||||||
capabilities["extra_fields"], custom_serializer=cv.custom_serializer
|
capabilities["extra_fields"], custom_serializer=cv.custom_serializer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user