File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from __future__ import annotations
2+
13import abc
24import asyncio
35import inspect
810
911from bleak import BleakClient
1012from bleak import exc
13+ from bleak .backends .device import BLEDevice
1114
1215_LOGGER = logging .getLogger (__name__ )
1316
@@ -76,9 +79,9 @@ class Tion:
7679 uuid_notify : str = ""
7780 uuid_write : str = ""
7881
79- def __init__ (self , mac : str ):
82+ def __init__ (self , mac : str | BLEDevice ):
8083 self ._mac = mac
81- self ._btle : BleakClient = BleakClient (self . mac )
84+ self ._btle : BleakClient = BleakClient (mac )
8285 self ._delegation = TionDelegation ()
8386 self ._fan_speed = 0
8487 self ._model : str = self .__class__ .__name__
@@ -257,7 +260,7 @@ async def set(self, new_settings=None) -> None:
257260 @final
258261 @property
259262 def mac (self ):
260- return self ._mac
263+ return self ._mac . address if isinstance ( self . _mac , BLEDevice ) else self . _mac
261264
262265 @staticmethod
263266 def decode_temperature (raw : int ) -> int :
You can’t perform that action at this time.
0 commit comments