in smart-mirror-full/extracted/device/script/agt_smart_mirror.py [0:0]
def on_alexa_gadget_statelistener_stateupdate(self, directive):
"""
This will trigger when your connected Alexa device changes state. Here we listening for your Alexa to react to you saying "Alexa..." or "Echo..."
"""
for state in directive.payload.states:
if state.name == 'wakeword':
if state.value == 'active':
logger.info('Wake word active')
self.showColorOptions['color'] = webcolors.name_to_rgb('yellow')
self.startAction(Actions.ShowColor)
elif state.value == 'cleared':
logger.info('Wake word cleared')
self.startAction(self.lastAction)