Created
August 27, 2020 17:04
-
-
Save garystafford/ba5363cff141764bab8d9ef741471616 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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