refactor: refactor miot mips & fix type errors (#365)

* remove use of tev & fix type errors

* lint fix

* make private classes private

* simplify inheritance

* fix thread naming

* fix the deleted public data class

* remove tev

* fix access violation

* style: format code

* style: param init

* fix: fix event async set

* fix: fix mips re-connect error

---------

Co-authored-by: topsworld <sworldtop@gmail.com>
This commit is contained in:
Feng Wang
2025-01-10 21:46:00 +08:00
committed by GitHub
parent 152933a223
commit 9ceca34b28
7 changed files with 493 additions and 1077 deletions

View File

@ -48,7 +48,7 @@ MIoT internationalization translation.
import asyncio
import logging
import os
from typing import Optional
from typing import Optional, Union
# pylint: disable=relative-beyond-top-level
from .common import load_json_file
@ -98,7 +98,7 @@ class MIoTI18n:
def translate(
self, key: str, replace: Optional[dict[str, str]] = None
) -> str | dict | None:
) -> Union[str, dict, None]:
result = self._data
for item in key.split('.'):
if item not in result: