Skip to content

Commit

Permalink
Fix pylint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mschlenstedt committed Aug 10, 2024
1 parent ec071c8 commit 7b64dc7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions mqtt_io/modules/sensor/veml7700.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def setup_module(self) -> None:
"800": 'ALS_800MS',
}
if 'integration_time' in self.config:
self.veml7700.light_integration_time = getattr(self.veml7700, ints[str(self.config['integration_time'])])
self.veml7700.light_integration_time = getattr(self.veml7700,
ints[str(self.config['integration_time'])])

#print("veml7700 Gain = {}".format(self.veml7700.light_gain))
#print("veml7700 Integration time = {}".format(self.veml7700.light_integration_time))
Expand All @@ -94,11 +95,11 @@ def get_value(self, sens_conf: ConfigType) -> SensorValueType:
"lux_corrected": "-1",
}

# Correction formula according to https://www.vishay.com/docs/84323/designingveml7700.pdf for lux > 1000
if data['lux'] > 1000:
data['lux_corrected'] = (6.0135e-13 * data['lux'] ** 4) + (-9.3924e-9 * data['lux'] ** 3) + (8.1488e-5 * data['lux'] ** 2) + (1.0023 * data['lux'])
else:
data['lux_corrected'] = data['lux']
data['lux_corrected'] = (6.0135e-13 * data['lux'] ** 4) + \
(-9.3924e-9 * data['lux'] ** 3) + \
(8.1488e-5 * data['lux'] ** 2) + \
(1.0023 * data['lux'])

return cast(
float,
Expand Down

0 comments on commit 7b64dc7

Please sign in to comment.