From 408ae5c524e8f0f124d5f0fd953e02d0c745df27 Mon Sep 17 00:00:00 2001 From: Michael Schlenstedt Date: Mon, 19 Aug 2024 06:52:33 +0200 Subject: [PATCH] Set lux_corrected if < 1000; corrected Readme --- README.md | 5 +++-- mqtt_io/modules/sensor/veml7700.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ee977f7c..d8779aa4 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,8 @@ Hardware support is provided by specific GPIO, Sensor and Stream modules. It's e - DHT11/DHT22/AM2302 temperature and humidity sensors (`dht22`) - DS18S20/DS1822/DS18B20/DS1825/DS28EA00/MAX31850K temperature sensors (`ds18b`) - ENS160 digital multi-gas sensor with multiple IAQ data (TVOC, eCO2, AQI) (`ens160`) - - FLOWSENSOR generic flow rate sensor like YF-S201 or YF-DN50 (`flowsensor`) - - FREQUENCYCOUNTER Counts pulses from GPIOs and return the frequency in Hz (frequencycounter) + - FLOWSENSOR generic flow rate sensor like YF-S201, YF-DN50 or others (`flowsensor`) + - FREQUENCYCOUNTER Counts pulses from GPIOs and return the frequency in Hz (`frequencycounterr`) - HCSR04 ultrasonic range sensor (connected to the Raspberry Pi on-board GPIO) (`hcsr04`) - INA219 DC current sensor (`ina219`) - LM75 temperature sensor (`lm75`) @@ -47,6 +47,7 @@ Hardware support is provided by specific GPIO, Sensor and Stream modules. It's e - ADXl345 3-axis accelerometer up to ±16g (`adxl345`) - PMS5003 particulate sensor (`pms5003`) - SHT40/SHT41/SHT45 temperature and humidity sensors (`sht4x`) + - TLSl2561 light level sensor (`tsl2561`) - VEML7700 light level sensor (`veml7700`) - YF-S201 flow rate sensor (`yfs201`) diff --git a/mqtt_io/modules/sensor/veml7700.py b/mqtt_io/modules/sensor/veml7700.py index 9a3c537a..ea1baebc 100644 --- a/mqtt_io/modules/sensor/veml7700.py +++ b/mqtt_io/modules/sensor/veml7700.py @@ -100,6 +100,8 @@ def get_value(self, sens_conf: ConfigType) -> SensorValueType: (-9.3924e-9 * data['lux'] ** 3) + \ (8.1488e-5 * data['lux'] ** 2) + \ (1.0023 * data['lux']) + else: + data['lux_corrected'] = data['lux'] return cast( float,