Stop dial tone after one number is dialed, set waiting time before starting a call to 5s

This commit is contained in:
klonfish 2015-05-19 21:08:25 +02:00
parent b6f5efd6ab
commit 3ceb7fade3

View file

@ -166,10 +166,12 @@ class DialingState(AbstractState):
def __init__(self, controller):
super(DialingState, self).__init__(controller)
self._controller.get_phone().play_dial_tone()
self.__dial_tone = True
self.__number = ''
def __on_leave(self):
self._controller.get_phone().stop_playing()
if self.__dial_tone:
self._controller.get_phone().stop_playing()
self._controller.abort_timeout()
def on_gabelschalter_down(self):
@ -178,9 +180,11 @@ class DialingState(AbstractState):
def on_nummernschalter_input(self, num):
print('nummernschalter: %d' % (num))
if self.__dial_tone:
self._controller.get_phone().stop_playing()
self.__number += str(num)
self._controller.abort_timeout()
self._controller.set_timeout(7000)
self._controller.set_timeout(5000)
def on_timeout(self):
self.__on_leave()