Skip to content

Commit 7ff793f

Browse files
committed
feat: added support for Tion Lite
fixes #2
1 parent 6f6d5ac commit 7ff793f

4 files changed

Lines changed: 442 additions & 18 deletions

File tree

tests/lite.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import logging
2+
import sys
3+
from tion_btle.lite import Lite
4+
5+
logging.basicConfig(level=logging.DEBUG)
6+
_LOGGER = logging.getLogger(__name__)
7+
_LOGGER.setLevel("DEBUG")
8+
try:
9+
mac = sys.argv[1]
10+
except IndexError:
11+
mac = "dummy"
12+
13+
device = Lite(mac)
14+
15+
result = device.get()
16+
print("crc is: " + bytes(device._crc).hex())
17+
18+
print("header._package_size = %s" % device._package_size)
19+
print("header_commad_type = %s" % bytes(device._command_type).hex())
20+
21+
_LOGGER.debug("Result is %s " % result)
22+
23+
_LOGGER.info("Initial state: device is %s, light is %s, sound is %s, heater is %s, fan_speed is %d, target_temp is %d",
24+
device.state,
25+
device.light,
26+
device.sound,
27+
device.heater,
28+
device.fan_speed,
29+
device.target_temp
30+
)
31+
32+

0 commit comments

Comments
 (0)