1
0
mirror of https://github.com/no2chem/wideq.git synced 2025-05-15 23:00:18 -07:00

Example to turn on/off a device

This commit is contained in:
Adrian Sampson 2018-02-18 11:40:31 -05:00
parent 7f7988effa
commit dd9ff96b39

View File

@ -97,11 +97,19 @@ def set_temp(client, device_id, temp):
ac.set_fahrenheit(int(temp))
def turn(client, device_id, on_off):
"""Turn on/off an AC device."""
ac = wideq.ACDevice(client, client.get_device(device_id))
ac.set_on(on_off == 'on')
EXAMPLE_COMMANDS = {
'ls': ls,
'mon': mon,
'ac-mon': ac_mon,
'set-temp': set_temp,
'turn': turn,
}