-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_discovery.py
More file actions
36 lines (28 loc) · 1020 Bytes
/
Copy pathdebug_discovery.py
File metadata and controls
36 lines (28 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import broadlink
import sys
HOST = "192.168.178.170"
print(f"Attempting to discover device at {HOST}...")
try:
devices = broadlink.discover(discover_ip_address=HOST, timeout=5)
if devices:
dev = devices[0]
print(f"Success! Found device: {dev}")
print(f"Type: {hex(dev.devtype)}")
print(f"MAC: {dev.mac.hex()}")
print(f"Host: {dev.host}")
print("Attempting authentication...")
if dev.auth():
print("Authentication SUCCESS!")
else:
print("Authentication FAILED.")
print("Attempting to get status...")
try:
# Try to read status
# For 0x4f9b ACs, usually we send a specific packet, but let's try generic check_sensors if available or just auth
pass
except Exception as e:
print(f"Get status error: {e}")
else:
print("Discovery returned no devices.")
except Exception as e:
print(f"Error during discovery: {e}")