mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +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(
|
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]
|
for cc in sorted(node.command_classes, key=lambda cc: cc.name) # type: ignore[no-any-return]
|
||||||
if cc.id != CommandClass.CONFIGURATION
|
if cc.id != CommandClass.CONFIGURATION
|
||||||
}
|
}
|
||||||
|
@ -497,7 +497,7 @@ async def async_get_trigger_capabilities(
|
|||||||
{
|
{
|
||||||
vol.Required(ATTR_COMMAND_CLASS): vol.In(
|
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]
|
for cc in sorted(node.command_classes, key=lambda cc: cc.name) # type: ignore[no-any-return]
|
||||||
if cc.id != CommandClass.CONFIGURATION
|
if cc.id != CommandClass.CONFIGURATION
|
||||||
}
|
}
|
||||||
|
@ -431,15 +431,15 @@ async def test_get_condition_capabilities_value(
|
|||||||
assert capabilities and "extra_fields" in capabilities
|
assert capabilities and "extra_fields" in capabilities
|
||||||
|
|
||||||
cc_options = [
|
cc_options = [
|
||||||
(133, "ASSOCIATION"),
|
(133, "Association"),
|
||||||
(128, "BATTERY"),
|
(128, "Battery"),
|
||||||
(98, "DOOR_LOCK"),
|
(98, "Door Lock"),
|
||||||
(122, "FIRMWARE_UPDATE_MD"),
|
(122, "Firmware Update Meta Data"),
|
||||||
(114, "MANUFACTURER_SPECIFIC"),
|
(114, "Manufacturer Specific"),
|
||||||
(113, "NOTIFICATION"),
|
(113, "Notification"),
|
||||||
(152, "SECURITY"),
|
(152, "Security"),
|
||||||
(99, "USER_CODE"),
|
(99, "User Code"),
|
||||||
(134, "VERSION"),
|
(134, "Version"),
|
||||||
]
|
]
|
||||||
|
|
||||||
assert voluptuous_serialize.convert(
|
assert voluptuous_serialize.convert(
|
||||||
|
@ -1085,15 +1085,15 @@ async def test_get_trigger_capabilities_value_updated_value(
|
|||||||
"required": True,
|
"required": True,
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"options": [
|
"options": [
|
||||||
(133, "ASSOCIATION"),
|
(133, "Association"),
|
||||||
(128, "BATTERY"),
|
(128, "Battery"),
|
||||||
(98, "DOOR_LOCK"),
|
(98, "Door Lock"),
|
||||||
(122, "FIRMWARE_UPDATE_MD"),
|
(122, "Firmware Update Meta Data"),
|
||||||
(114, "MANUFACTURER_SPECIFIC"),
|
(114, "Manufacturer Specific"),
|
||||||
(113, "NOTIFICATION"),
|
(113, "Notification"),
|
||||||
(152, "SECURITY"),
|
(152, "Security"),
|
||||||
(99, "USER_CODE"),
|
(99, "User Code"),
|
||||||
(134, "VERSION"),
|
(134, "Version"),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{"name": "property", "required": True, "type": "string"},
|
{"name": "property", "required": True, "type": "string"},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user