Add has_firmware_update_cc
bool to zwave_js/node_status cmd (#87310)
* Add `has_firmware_update_cc` bool to zwave_js/node_status cmd * fix test * Switch order of equality check
This commit is contained in:
parent
8cd5106c15
commit
8aa64c8008
3 changed files with 6 additions and 1 deletions
|
@ -518,7 +518,7 @@ class NodeEvents:
|
|||
# Create a firmware update entity for each non-controller device that
|
||||
# supports firmware updates
|
||||
if not node.is_controller_node and any(
|
||||
CommandClass.FIRMWARE_UPDATE_MD.value == cc.id
|
||||
cc.id == CommandClass.FIRMWARE_UPDATE_MD.value
|
||||
for cc in node.command_classes
|
||||
):
|
||||
await self.controller_events.driver_events.async_setup_platform(
|
||||
|
|
|
@ -374,6 +374,10 @@ def node_status(node: Node) -> dict[str, Any]:
|
|||
"zwave_plus_version": node.zwave_plus_version,
|
||||
"highest_security_class": node.highest_security_class,
|
||||
"is_controller_node": node.is_controller_node,
|
||||
"has_firmware_update_cc": any(
|
||||
cc.id == CommandClass.FIRMWARE_UPDATE_MD.value
|
||||
for cc in node.command_classes
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -319,6 +319,7 @@ async def test_node_status(hass, multisensor_6, integration, hass_ws_client):
|
|||
assert result["zwave_plus_version"] == 1
|
||||
assert result["highest_security_class"] == SecurityClass.S0_LEGACY
|
||||
assert not result["is_controller_node"]
|
||||
assert not result["has_firmware_update_cc"]
|
||||
|
||||
# Test getting non-existent node fails
|
||||
await ws_client.send_json(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue