Skip to content

Commit

Permalink
Remove Configuration CC as choice in zwave_js value device condition (h…
Browse files Browse the repository at this point in the history
  • Loading branch information
raman325 authored Aug 21, 2021
1 parent 8796eae commit 1075a65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions homeassistant/components/zwave_js/device_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,16 @@ async def async_get_condition_capabilities(
return {"extra_fields": vol.Schema({vol.Required(ATTR_VALUE): value_schema})}

if config[CONF_TYPE] == VALUE_TYPE:
# Only show command classes on this node and exclude Configuration CC since it
# is already covered
return {
"extra_fields": vol.Schema(
{
vol.Required(ATTR_COMMAND_CLASS): vol.In(
{
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]
if cc.id != CommandClass.CONFIGURATION
}
),
vol.Required(ATTR_PROPERTY): cv.string,
Expand Down
1 change: 0 additions & 1 deletion tests/components/zwave_js/test_device_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ async def test_get_condition_capabilities_value(
cc_options = [
(133, "ASSOCIATION"),
(128, "BATTERY"),
(112, "CONFIGURATION"),
(98, "DOOR_LOCK"),
(122, "FIRMWARE_UPDATE_MD"),
(114, "MANUFACTURER_SPECIFIC"),
Expand Down

0 comments on commit 1075a65

Please sign in to comment.