Improve Command Class choices for zwave_js device triggers and conditions (#54970)

This commit is contained in:
Raman Gupta 2021-08-21 02:57:20 -04:00 committed by GitHub
parent 2be50eb5b4
commit 726acc38c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 20 deletions

View File

@ -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
}

View File

@ -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
}

View File

@ -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(

View File

@ -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"},