Skip to content

Commit

Permalink
Merge branch 'main' into prod-lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
Fruittips committed Nov 25, 2023
2 parents 9cea5fa + 7866f48 commit 8e64850
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lambda/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
SUPABASE_KEY = os.environ.get("SUPABASE_KEY")

supabase: Client = create_client(SUPABASE_URL, SUPABASE_KEY)
PAST_RECORDS_DURATION = 120 # in minutes
PAST_RECORDS_DURATION = 5 # in minutes

def lambda_handler(event, context):
rowId = event.get('rowId')
Expand Down Expand Up @@ -49,14 +49,14 @@ def lambda_handler(event, context):
.execute()
except Exception as e:
print(f"Error updating row in supabase: {e}")

return {
return json.dumps({
'statusCode': 200,
'body': json.dumps({
'fire_probability': fire_probability,
'r_value': r_value,
})
}
})

def get_fire_probability (temp, aq_arr , flame_presence, r_value):
p_flame = flame_presence
Expand Down Expand Up @@ -103,10 +103,10 @@ def get_r_value(temp_arr, humidity_arr):
r_actual = r_corrcoef[0][1]
return r_actual

# #TODO: DONT PUSH THIS REMOVE IT BEFORE PUSHING
# # #TODO: DONT PUSH THIS REMOVE IT BEFORE PUSHING
# if __name__ == "__main__":
# lambda_handler({
# "rowId":646,
# "rowId":810,
# "temp":30.9,
# "flame": 0,
# }, None)

0 comments on commit 8e64850

Please sign in to comment.