mirror of
https://github.com/mjg59/python-broadlink.git
synced 2024-11-13 03:00:11 +01:00
Only get temperature for devices that support it. (#102)
Calling check_temperature is only possible on the RM family of devices. The program used to crash if other types of devices were discovered (A1, MP1 etc.).
This commit is contained in:
parent
2e2c8ef1a1
commit
3d4789305e
@ -19,7 +19,8 @@ for device in devices:
|
||||
print "# broadlink_cli --type 0x2712 --host {} --mac {}".format(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 "temperature = {}".format(device.check_temperature())
|
||||
if hasattr(device, 'check_temperature'):
|
||||
print "temperature = {}".format(device.check_temperature())
|
||||
print ""
|
||||
else:
|
||||
print "Error authenticating with device : {}".format(device.host)
|
||||
|
Loading…
Reference in New Issue
Block a user