in smart-mirror-full/extracted/lambda/custom/lambda_function.py [0:0]
def yes_intent_handler(handler_input: HandlerInput):
logger.info("ShowColor received. Sending color to device.")
color_slot = "Color"
# Retrieve the stored gadget endpointId from the SessionAttributes.
session_attr = handler_input.attributes_manager.session_attributes
endpoint_id = session_attr['endpointId']
response_builder = handler_input.response_builder
slots = handler_input.request_envelope.request.intent.slots
if color_slot in slots:
color = slots[color_slot].value
(response_builder
.speak(f'Alright. Lighting up in {color}')
.add_directive(build_showcolor_directive(endpoint_id, color))
.set_should_end_session(True))
else:
(response_builder
.speak("Can you please repeat that?")
.set_should_end_session(False))
return response_builder.response