style: format code

This commit is contained in:
topsworld 2025-01-09 15:22:47 +08:00
parent 0668985969
commit 43fc8c4d56

View File

@ -162,7 +162,6 @@ class _MipsRequest:
timer: asyncio.TimerHandle | None
@dataclass
class _MipsBroadcast:
"""MIoT Pub/Sub broadcast."""
@ -196,6 +195,7 @@ class MIoTDeviceState(Enum):
OFFLINE = auto()
ONLINE = auto()
@dataclass
class MipsDeviceState:
"""MIoT Pub/Sub device state."""
@ -208,6 +208,7 @@ class MipsDeviceState:
handler: Callable[[str, MIoTDeviceState, Any], None] | None = None
handler_ctx: Any = None
class _MipsClient(ABC):
"""MIoT Pub/Sub client."""
# pylint: disable=unused-argument
@ -292,7 +293,6 @@ class _MipsClient(ABC):
self._mips_sub_pending_timer = None
# DO NOT start the thread yet. Do that on connect
@property
def client_id(self) -> str:
return self._client_id
@ -323,8 +323,8 @@ class _MipsClient(ABC):
self._internal_loop = asyncio.new_event_loop()
self._mips_thread = threading.Thread(target=self.__mips_loop_thread)
self._mips_thread.daemon = True
self._mips_thread.name = \
self._client_id if thread_name is None else thread_name
self._mips_thread.name = (
self._client_id if thread_name is None else thread_name)
self._mips_thread.start()
@final
@ -1440,7 +1440,7 @@ class MipsLocalClient(_MipsClient):
# Sub broadcast topic
for topic, _ in list(self._msg_matcher.iter_all_nodes()):
self._mips_sub_internal(
topic=re.sub(f'^{self._did}', 'master', topic))\
topic=re.sub(f'^{self._did}', 'master', topic))
@final
def _on_mips_disconnect(self, rc: int, props: dict) -> None: