Skip to content

Commit

Permalink
BridgedDevice --> BridgedNode
Browse files Browse the repository at this point in the history
  • Loading branch information
lboue authored Nov 7, 2024
1 parent 80f4f5f commit 4320f7c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions matter_server/client/models/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .device_types import (
ALL_TYPES as DEVICE_TYPES,
Aggregator,
BridgedDevice,
BridgedNode,
DeviceType,
RootNode,
)
Expand Down Expand Up @@ -75,7 +75,7 @@ def __init__(
@property
def is_bridged_device(self) -> bool:
"""Return if this endpoint represents a Bridged device."""
return BridgedDevice in self.device_types
return BridgedNode in self.device_types

@property
def is_composed_device(self) -> bool:
Expand All @@ -85,16 +85,16 @@ def is_composed_device(self) -> bool:
@property
def device_info(
self,
) -> Clusters.BasicInformation | Clusters.BridgedDeviceBasicInformation:
) -> Clusters.BasicInformation | Clusters.BridgedNodeBasicInformation:
"""
Return device info.
If this endpoint represents a BridgedDevice, returns BridgedDeviceBasic.
If this endpoint represents a BridgedNode, returns BridgedNodeBasic.
If this endpoint represents a ComposedDevice, returns the info of the compose device.
Otherwise, returns BasicInformation from the Node itself (endpoint 0).
"""
if self.is_bridged_device:
return self.get_cluster(Clusters.BridgedDeviceBasicInformation)
return self.get_cluster(Clusters.BridgedNodeBasicInformation)
if compose_parent := self.node.get_compose_parent(self.endpoint_id):
return compose_parent.device_info
return self.node.device_info
Expand Down

0 comments on commit 4320f7c

Please sign in to comment.