1
0
mirror of https://github.com/cmur2/python-veml6070.git synced 2025-06-26 12:30:19 +02:00

module: add estimated risk level calculation based on UVA light intensity

- thresholds from vendor, take with a grain of salt as these are estimations
This commit is contained in:
cn
2019-09-19 01:36:31 +02:00
parent 4eda08a9c9
commit 1bdfe0e54a
2 changed files with 27 additions and 0 deletions

View File

@ -102,3 +102,19 @@ class Veml6070(object):
INTEGRATIONTIME_4T: 4
}
return self.rset * RSET_TO_REFRESHTIME_SCALE * case_refresh_it[self.integration_time]
@staticmethod
def get_estimated_risk_level(intensity):
"""
returns estimated risk level from comparing UVA light intensity value
in W/(m*m) as parameter, thresholds calculated from application notes
"""
if intensity < 24.888:
return "low"
if intensity < 49.800:
return "moderate"
if intensity < 66.400:
return "high"
if intensity < 91.288:
return "very high"
return "extreme"