Skip to content

Commit

Permalink
some linting
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Jun 26, 2023
1 parent 1c16fc6 commit 8f5ee31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions matter_server/server/device_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
from chip.clusters import Attribute, Objects as Clusters
from chip.clusters.Attribute import ValueDecodeFailure
from chip.clusters.ClusterObjects import (
ALL_ATTRIBUTES,
ALL_CLUSTERS,
Cluster,
ClusterAttributeDescriptor,
ALL_ATTRIBUTES,
)
from chip.exceptions import ChipStackError

Expand All @@ -32,8 +32,8 @@
from ..common.helpers.util import (
create_attribute_path,
create_attribute_path_from_attribute,
parse_attribute_path,
dataclass_from_dict,
parse_attribute_path,
)
from ..common.models import APICommand, EventType, MatterNodeData
from .const import PAA_ROOT_CERTS_DIR
Expand Down Expand Up @@ -331,8 +331,8 @@ async def interview_node(self, node_id: int) -> None:
if existing_info:
node.attribute_subscriptions = existing_info.attribute_subscriptions
# work out if the node is a bridge device by looking at the devicetype of endpoint 1
attr_data: list[Clusters.Descriptor.Structs.DeviceTypeStruct]
if attr_data := node.attributes.get("1/29/0"):
attr_data: list[Clusters.Descriptor.Structs.DeviceTypeStruct]
node.is_bridge = any(x.deviceType == 14 for x in attr_data)

# save updated node data
Expand Down
3 changes: 2 additions & 1 deletion matter_server/server/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ def save(self, immediate: bool = False) -> None:
"""Schedule save of data to disk."""
assert self.server.loop is not None

def _do_save():
def _do_save() -> None:
assert self.server.loop is not None
self.server.loop.create_task(self.async_save())

if self._timer_handle is not None:
Expand Down

0 comments on commit 8f5ee31

Please sign in to comment.