in locator/locator.py [0:0]
def verify_person_at_location(self, **kwargs):
if not self.person.require_physical_confirmation or \
not hasattr(self.location, 'input_capabilities'):
return True, 0, 0
if len(self.location.input_capabilities.keys()) > 0:
id = kwargs.get('HardwareId')
speech_method = kwargs.get('SpeechMethod')
if id:
s_id = id
else:
s_id = random.choice(self.location.input_capabilities.keys())
s = Switch(HardwareId=s_id,
TimeoutInSeconds=self.timeout_in_secs)
c = 0
done = False
while c < self.retry_count and not done:
c = c + 1
i_name = self.location.input_capabilities[s_id]['name']
speech_method(Message='Please push the {}'.format(i_name),
IncludeChime=True,
VoiceId=self.voice)
done, timeout = s.wait_for_input()
return done, c, timeout