Skip to content

Instantly share code, notes, and snippets.

@alexcasalboni alexcasalboni/
Last active Mar 22, 2019

What would you like to do?
AWS Iot 1-Click Event - Lambda handler (Python)
from click_handler import DailyClickHandler
def handler(event, context):
if 'deviceEvent' in event:
if 'deviceHealthMonitor' in event['deviceEvent']:
# just a health check
return "OK"
elif 'buttonClicked' in event['deviceEvent']:
# a real click
click_handler = DailyClickHandler(event['deviceEvent']['buttonClicked'])
return "OK"
raise Exception("Invalid event %s " % event)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.