power on 2 clicks, light on 1 click
This commit is contained in:
parent
e753dcf093
commit
1962b35c8b
|
@ -85,15 +85,15 @@ def exec_chch_button_cmd(event):
|
||||||
else:
|
else:
|
||||||
sys.stderr.write("No mode with " + str(count) + " short press and a long press\n")
|
sys.stderr.write("No mode with " + str(count) + " short press and a long press\n")
|
||||||
else:
|
else:
|
||||||
# '.' toggle current room
|
# '.' room specific function
|
||||||
if count == 1:
|
elif count == 1:
|
||||||
event.chip.output_pins[event.pin_num].toggle()
|
|
||||||
# '. .' room specific function
|
|
||||||
elif count == 2:
|
|
||||||
if event.pin_num == 0:
|
if event.pin_num == 0:
|
||||||
call(["/home/automation/chch-power/light.sh"])
|
call(["/home/automation/chch-power/light.sh"])
|
||||||
else:
|
else:
|
||||||
sys.stderr.write("No room specific function for room " + str(event.pin_num) + "\n")
|
sys.stderr.write("No room specific function for room " + str(event.pin_num) + "\n")
|
||||||
|
# '. .' toggle current room
|
||||||
|
if count == 2:
|
||||||
|
event.chip.output_pins[event.pin_num].toggle()
|
||||||
else:
|
else:
|
||||||
sys.stderr.write("No mode with " + str(count) + " short press at pin " + str(event.pin_num) + "\n")
|
sys.stderr.write("No mode with " + str(count) + " short press at pin " + str(event.pin_num) + "\n")
|
||||||
chch_status_output(event.chip)
|
chch_status_output(event.chip)
|
||||||
|
|
Loading…
Reference in New Issue