mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 05:37:44 +00:00
Improve Command Class choices for zwave_js device triggers and conditions (#54970)
This commit is contained in:
parent
2be50eb5b4
commit
726acc38c6
@ -200,7 +200,7 @@ async def async_get_condition_capabilities(
|
||||
{
|
||||
vol.Required(ATTR_COMMAND_CLASS): vol.In(
|
||||
{
|
||||
CommandClass(cc.id).value: CommandClass(cc.id).name
|
||||
CommandClass(cc.id).value: cc.name
|
||||
for cc in sorted(node.command_classes, key=lambda cc: cc.name) # type: ignore[no-any-return]
|
||||
if cc.id != CommandClass.CONFIGURATION
|
||||
}
|
||||
|
@ -497,7 +497,7 @@ async def async_get_trigger_capabilities(
|
||||
{
|
||||
vol.Required(ATTR_COMMAND_CLASS): vol.In(
|
||||
{
|
||||
CommandClass(cc.id).value: CommandClass(cc.id).name
|
||||
CommandClass(cc.id).value: cc.name
|
||||
for cc in sorted(node.command_classes, key=lambda cc: cc.name) # type: ignore[no-any-return]
|
||||
if cc.id != CommandClass.CONFIGURATION
|
||||
}
|
||||
|
@ -431,15 +431,15 @@ async def test_get_condition_capabilities_value(
|
||||
assert capabilities and "extra_fields" in capabilities
|
||||
|
||||
cc_options = [
|
||||
(133, "ASSOCIATION"),
|
||||
(128, "BATTERY"),
|
||||
(98, "DOOR_LOCK"),
|
||||
(122, "FIRMWARE_UPDATE_MD"),
|
||||
(114, "MANUFACTURER_SPECIFIC"),
|
||||
(113, "NOTIFICATION"),
|
||||
(152, "SECURITY"),
|
||||
(99, "USER_CODE"),
|
||||
(134, "VERSION"),
|
||||
(133, "Association"),
|
||||
(128, "Battery"),
|
||||
(98, "Door Lock"),
|
||||
(122, "Firmware Update Meta Data"),
|
||||
(114, "Manufacturer Specific"),
|
||||
(113, "Notification"),
|
||||
(152, "Security"),
|
||||
(99, "User Code"),
|
||||
(134, "Version"),
|
||||
]
|
||||
|
||||
assert voluptuous_serialize.convert(
|
||||
|
@ -1085,15 +1085,15 @@ async def test_get_trigger_capabilities_value_updated_value(
|
||||
"required": True,
|
||||
"type": "select",
|
||||
"options": [
|
||||
(133, "ASSOCIATION"),
|
||||
(128, "BATTERY"),
|
||||
(98, "DOOR_LOCK"),
|
||||
(122, "FIRMWARE_UPDATE_MD"),
|
||||
(114, "MANUFACTURER_SPECIFIC"),
|
||||
(113, "NOTIFICATION"),
|
||||
(152, "SECURITY"),
|
||||
(99, "USER_CODE"),
|
||||
(134, "VERSION"),
|
||||
(133, "Association"),
|
||||
(128, "Battery"),
|
||||
(98, "Door Lock"),
|
||||
(122, "Firmware Update Meta Data"),
|
||||
(114, "Manufacturer Specific"),
|
||||
(113, "Notification"),
|
||||
(152, "Security"),
|
||||
(99, "User Code"),
|
||||
(134, "Version"),
|
||||
],
|
||||
},
|
||||
{"name": "property", "required": True, "type": "string"},
|
||||
|
Loading…
x
Reference in New Issue
Block a user