Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion matter_server/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ async def get_matter_fabrics(self, node_id: int) -> list[MatterFabricData]:
fabric_id=f.fabricID,
vendor_id=f.vendorID,
fabric_index=f.fabricIndex,
fabric_label=f.label if f.label else None,
fabric_label=f.label or None,
vendor_name=vendors_map.get(str(f.vendorID)),
)
for f in fabrics
Expand Down
2 changes: 1 addition & 1 deletion matter_server/client/models/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def update(self, node_data: MatterNodeData) -> None:

def update_attribute(self, attribute_path: str, new_value: Any) -> None:
"""Handle Attribute value update."""
endpoint_id = int(attribute_path.split("/")[0])
endpoint_id = int(attribute_path.split("/", maxsplit=1)[0])
if endpoint_id not in self.endpoints:
# race condition when a bridge is in the process of adding a new endpoint
return
Expand Down
4 changes: 2 additions & 2 deletions matter_server/common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from collections.abc import Callable
from dataclasses import dataclass, field
from datetime import datetime # noqa: TC003
from enum import Enum
from enum import Enum, StrEnum
from typing import Any

# Enums and constants
Expand All @@ -25,7 +25,7 @@ class EventType(Enum):
ENDPOINT_REMOVED = "endpoint_removed"


class APICommand(str, Enum):
class APICommand(StrEnum):
"""Enum with all known API commands."""

START_LISTENING = "start_listening"
Expand Down
2 changes: 1 addition & 1 deletion matter_server/server/ota/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ async def fetch_update(self, update_desc: dict) -> None:

if parsed_url.scheme in ["http", "https"]:
file_path = await self._download_update(url, checksum_alg)
elif parsed_url.scheme in ["file"]:
elif parsed_url.scheme == "file":
file_path = self._ota_provider_base_dir / Path(parsed_url.path[1:])
if not await asyncio.to_thread(file_path.exists):
LOGGER.warning("Local update file not found: %s", file_path)
Expand Down
2 changes: 1 addition & 1 deletion matter_server/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def scope_ipv6_lla(self, ip_addr: str) -> str:

if ip_addr_parsed.scope_id is not None:
# This type of IPv6 manipulation is not supported by the ipaddress lib
ip_addr = ip_addr.split("%")[0]
ip_addr = ip_addr.split("%", maxsplit=1)[0]

# Rely on host OS routing table
if self.primary_interface is None:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ test = [
"pytest-asyncio==1.3.0",
"pytest-aiohttp==1.1.0",
"pytest-cov==7.0.0",
"ruff==0.14.14",
"ruff==0.15.1",
"tomli==2.4.0",
]

Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def gen_cls_name(name: str):
if char in ("-", "/"):
next_upper = True
continue
elif char in ("."):
elif char == ".":
continue
elif next_upper:
char = char.upper()
Expand Down