|
|
|
@ -166,10 +166,12 @@ class DialingState(AbstractState):
@@ -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):
@@ -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() |
|
|
|
|