From f411231931de6dfd6d8c800d7273af966e96977a Mon Sep 17 00:00:00 2001 From: root Date: Sun, 19 Feb 2017 01:35:46 +0100 Subject: [PATCH] moved config block and something else marenz did --- chch-power.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/chch-power.py b/chch-power.py index c20fd36..71a487b 100644 --- a/chch-power.py +++ b/chch-power.py @@ -4,6 +4,15 @@ import time from subprocess import call import sys +button_count = 2 +longpress_delay = 0.4 +verylongpress_delay = 2 +shortpress_count_max_delay = 0.5 +inter_press_max_delay = 1.5 +pin_last_rise_date = [0]*button_count +pin_last_shortpress = [0]*button_count +pin_shortpress_count = [0]*button_count + # dirty workaround to disable reset of output pins def init_board_no_power_off(self): ioconfig = ( @@ -29,15 +38,6 @@ def init_board_no_power_off(self): setattr(pifacedigitalio.PiFaceDigital, 'init_board', init_board_no_power_off) -button_count = 2 -longpress_delay = 0.4 -verylongpress_delay = 2 -shortpress_count_max_delay = 0.5 -inter_press_max_delay = 1 -pin_last_rise_date = [0]*button_count -pin_last_shortpress = [0]*button_count -pin_shortpress_count = [0]*button_count - def chch_status_output(pfd): f = open("/tmp/status", 'w') status = "geschlossen"