fix: fix type error, wrong use of any and Any (#338)

* fix: fix type error, wrong use of any and Any

* fix: wrong use of session close

* fix: fix test_lan type error

* fix: remove __del__

* feat: oauth, http add deinit_async
This commit is contained in:
Paul Shawn
2024-12-22 10:46:58 +08:00
committed by GitHub
parent afef709839
commit c1867e2baf
18 changed files with 237 additions and 173 deletions

View File

@ -49,7 +49,7 @@ import asyncio
import json
import platform
import time
from typing import Optional
from typing import Any, Optional
from urllib.parse import urlencode
from urllib.request import Request, urlopen
import logging
@ -78,9 +78,9 @@ class MIoTSpecBase:
# External params
platform: str
device_class: any
device_class: Any
icon: str
external_unit: any
external_unit: Any
spec_id: str
@ -166,7 +166,7 @@ class MIoTSpecProperty(MIoTSpecBase):
def notifiable(self):
return self._notifiable
def value_format(self, value: any) -> any:
def value_format(self, value: Any) -> Any:
if value is None:
return None
if self.format_ == 'int':
@ -296,7 +296,7 @@ class MIoTSpecInstance:
# External params
platform: str
device_class: any
device_class: Any
icon: str
def __init__(