Skip to content

Instantly share code, notes, and snippets.

@alexcasalboni alexcasalboni/index.py
Last active Mar 22, 2019

Embed
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
print("HEALTHCHECK")
print(event)
return "OK"
elif 'buttonClicked' in event['deviceEvent']:
# a real click
click_handler = DailyClickHandler(event['deviceEvent']['buttonClicked'])
click_handler.run()
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.