Y3S2-IoT/flaskapp/dangercalc.py

13 lines
395 B
Python
Raw Permalink Normal View History

2020-06-09 20:34:42 +00:00
from flaskapp.models import DangerLevel
Critical_Temperature = 105
Critical_Light = 40
Critical_Humididty = 80
def danger_calculation(baro_pressure,light,humidity,avg_temp):
if avg_temp >= Critical_Temperature:
return DangerLevel.Critical
if light >= Critical_Light:
return DangerLevel.Critical
if humidity >= Critical_Humididty:
return DangerLevel.Critical