diff options
| author | Mark Powers <mark@marks.kitchen> | 2021-07-12 03:15:06 +0100 |
|---|---|---|
| committer | Mark Powers <mark@marks.kitchen> | 2021-07-12 03:15:06 +0100 |
| commit | c72abd79e4dbfd9b533d75bb00fea1ded9975d95 (patch) | |
| tree | 6056796286af31ea09d41faf9d6b57308e450ec4 /hangup.py | |
| parent | 1edb32ec29ca3c1bf4d1a53215ecb2544aa04a6e (diff) | |
Add config, weather event, and demo timer event demoing hang up event
Diffstat (limited to 'hangup.py')
| -rw-r--r-- | hangup.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -5,9 +5,10 @@ import time BUTTON_GPIO = 24 class HangUpThread(threading.Thread): - def __init__(self, phone_held, dial_manager): + def __init__(self, phone_held, phone_hung_up, dial_manager): threading.Thread.__init__(self, args=(), kwargs=None) self.phone_held = phone_held + self.phone_hung_up = phone_hung_up self.dial_manager = dial_manager self.daemon = True @@ -18,8 +19,10 @@ class HangUpThread(threading.Thread): while True: if not GPIO.input(BUTTON_GPIO): self.phone_held.clear() + self.phone_hung_up.set() self.dial_manager.clear_sequence() else: self.phone_held.set() + self.phone_hung_up.clear() time.sleep(0.1) |
