From 1962b35c8b036eb79a1a22713bc24ddfc7201057 Mon Sep 17 00:00:00 2001 From: Markus Schmidl Date: Thu, 2 Mar 2017 23:11:41 +0100 Subject: [PATCH] power on 2 clicks, light on 1 click --- chch-power.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/chch-power.py b/chch-power.py index b4bf87c..a90ae69 100644 --- a/chch-power.py +++ b/chch-power.py @@ -85,15 +85,15 @@ def exec_chch_button_cmd(event): else: sys.stderr.write("No mode with " + str(count) + " short press and a long press\n") else: - # '.' toggle current room - if count == 1: - event.chip.output_pins[event.pin_num].toggle() - # '. .' room specific function - elif count == 2: + # '.' room specific function + elif count == 1: if event.pin_num == 0: call(["/home/automation/chch-power/light.sh"]) else: 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: sys.stderr.write("No mode with " + str(count) + " short press at pin " + str(event.pin_num) + "\n") chch_status_output(event.chip)