mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2025-08-05 14:58:52 +08:00
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:
@ -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__(
|
||||
|
Reference in New Issue
Block a user