Skip to content

Instantly share code, notes, and snippets.

@garystafford
Created August 27, 2020 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garystafford/ba5363cff141764bab8d9ef741471616 to your computer and use it in GitHub Desktop.
Save garystafford/ba5363cff141764bab8d9ef741471616 to your computer and use it in GitHub Desktop.
def lambda_handler(event, context):
for e in event:
e['temperature'] = round((e['temperature'] * 1.8) + 32, 2)
e['humidity'] = round(e['humidity'], 2)
e['pressure'] = round((e['pressure'] / 3.3864), 2)
e['red'] = int(round(e['red'] / (4097 / 255), 0))
e['green'] = int(round(e['green'] / (4097 / 255), 0))
e['blue'] = int(round(e['blue'] / (4097 / 255), 0))
e['ambient'] = int(round(e['ambient'] / (4097 / 255), 0))
return event
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment