From 7b64dc75b5ea70ea70eab70926dc98b1339b4151 Mon Sep 17 00:00:00 2001 From: Michael Schlenstedt Date: Sat, 10 Aug 2024 12:01:28 +0200 Subject: [PATCH] Fix pylint errors --- mqtt_io/modules/sensor/veml7700.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mqtt_io/modules/sensor/veml7700.py b/mqtt_io/modules/sensor/veml7700.py index e01eb252..9a3c537a 100644 --- a/mqtt_io/modules/sensor/veml7700.py +++ b/mqtt_io/modules/sensor/veml7700.py @@ -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)) @@ -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,