broadlink_discovery returns wrong devtype (#157)
* few item in gendevice use `if` instead of `elif` * passing `devtype` back to device change `cli/broadlink_discovery` to display proper devtype
This commit is contained in:
parent
21d96bd140
commit
8754493951
2 changed files with 50 additions and 51 deletions
|
|
@ -8,17 +8,15 @@ parser = argparse.ArgumentParser(fromfile_prefix_chars='@');
|
|||
parser.add_argument("--timeout", type=int, default=5, help="timeout to wait for receiving discovery responses")
|
||||
args = parser.parse_args()
|
||||
|
||||
print "discover"
|
||||
print "Discovering..."
|
||||
devices = broadlink.discover(timeout=args.timeout)
|
||||
#print devices
|
||||
for device in devices:
|
||||
if device.auth():
|
||||
print "###########################################"
|
||||
# print device
|
||||
print device.type
|
||||
print "# broadlink_cli --type 0x2712 --host {} --mac {}".format(device.host[0], ''.join(format(x, '02x') for x in device.mac))
|
||||
print "# broadlink_cli --type {} --host {} --mac {}".format(hex(device.devtype), device.host[0], ''.join(format(x, '02x') for x in device.mac))
|
||||
print "Device file data (to be used with --device @filename in broadlink_cli) : "
|
||||
print "0x2712 {} {}".format(device.host[0], ''.join(format(x, '02x') for x in device.mac))
|
||||
print "{} {} {}".format(hex(device.devtype), device.host[0], ''.join(format(x, '02x') for x in device.mac))
|
||||
if hasattr(device, 'check_temperature'):
|
||||
print "temperature = {}".format(device.check_temperature())
|
||||
print ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue