Skip to content

Commit d5d16ae

Browse files
authored
Add active fabric index to diagnostics (#533)
1 parent 267cf3f commit d5d16ae

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

matter_server/client/client.py

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Matter Client implementation."""
2+
23
from __future__ import annotations
34

45
import asyncio
@@ -345,6 +346,10 @@ async def node_diagnostics(self, node_id: int) -> NodeDiagnostics:
345346
node_type = NodeType.BRIDGE
346347
# get active fabrics for this node
347348
active_fabrics = await self.get_matter_fabrics(node_id)
349+
# get active fabric index
350+
fabric_index = node.get_attribute_value(
351+
0, None, Clusters.OperationalCredentials.Attributes.CurrentFabricIndex
352+
)
348353
return NodeDiagnostics(
349354
node_id=node_id,
350355
network_type=network_type,
@@ -354,6 +359,7 @@ async def node_diagnostics(self, node_id: int) -> NodeDiagnostics:
354359
mac_address=mac_address,
355360
available=node.available,
356361
active_fabrics=active_fabrics,
362+
active_fabric_index=fabric_index,
357363
)
358364

359365
async def send_device_command(

matter_server/client/models/node.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Matter node."""
2+
23
from __future__ import annotations
34

45
from dataclasses import dataclass
@@ -402,3 +403,4 @@ class NodeDiagnostics:
402403
mac_address: str | None
403404
available: bool
404405
active_fabrics: list[MatterFabricData]
406+
active_fabric_index: int

0 commit comments

Comments
 (0)