mirror of
https://github.com/no2chem/wideq.git
synced 2025-05-16 23:30:10 -07:00
Example to turn on/off a device
This commit is contained in:
parent
7f7988effa
commit
dd9ff96b39
@ -97,11 +97,19 @@ def set_temp(client, device_id, temp):
|
|||||||
ac.set_fahrenheit(int(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 = {
|
EXAMPLE_COMMANDS = {
|
||||||
'ls': ls,
|
'ls': ls,
|
||||||
'mon': mon,
|
'mon': mon,
|
||||||
'ac-mon': ac_mon,
|
'ac-mon': ac_mon,
|
||||||
'set-temp': set_temp,
|
'set-temp': set_temp,
|
||||||
|
'turn': turn,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user