Adjust time, remove superflous sensors
This commit is contained in:
parent
2d41c5f5ca
commit
a0d9b877ea
@ -22,7 +22,7 @@
|
||||
|
||||
substitutions:
|
||||
# How long a PIR activation should be held for
|
||||
pir_holdtime: "10s"
|
||||
pir_holdtime: "15s"
|
||||
|
||||
esphome:
|
||||
name: supersensor
|
||||
@ -275,18 +275,11 @@ sensor:
|
||||
lambda: |-
|
||||
auto veml7700 = new VEML7700CustomSensor();
|
||||
App.register_component(veml7700);
|
||||
return {veml7700, veml7700->lux_sensor, veml7700->white_sensor, veml7700->als_sensor};
|
||||
return {veml7700->lux_sensor};
|
||||
sensors:
|
||||
- name: "VEML7700 Light" # Required dummy sensor
|
||||
- name: "VEML7700 Lux"
|
||||
- name: "VEML7700 Illumination"
|
||||
unit_of_measurement: Lux
|
||||
accuracy_decimals: 0
|
||||
- name: "VEML7700 White"
|
||||
unit_of_measurement: raw
|
||||
accuracy_decimals: 0
|
||||
- name: "VEML7700 ALS"
|
||||
unit_of_measurement: raw
|
||||
accuracy_decimals: 0
|
||||
|
||||
- platform: uptime
|
||||
name: "ESP32 Uptime"
|
||||
|
@ -9,8 +9,6 @@ class VEML7700CustomSensor : public PollingComponent, public Sensor {
|
||||
Adafruit_VEML7700 veml = Adafruit_VEML7700();
|
||||
|
||||
Sensor *lux_sensor = new Sensor();
|
||||
Sensor *white_sensor = new Sensor();
|
||||
Sensor *als_sensor = new Sensor();
|
||||
|
||||
VEML7700CustomSensor() : PollingComponent(5000) {}
|
||||
void setup() override {
|
||||
@ -27,13 +25,7 @@ class VEML7700CustomSensor : public PollingComponent, public Sensor {
|
||||
|
||||
void update() override {
|
||||
float lux = veml.readLux();
|
||||
float white = veml.readWhite();
|
||||
float als = veml.readALS();
|
||||
ESP_LOGD("VEML7700", "The value of sensor lux is: %.0f", lux);
|
||||
ESP_LOGD("VEML7700", "The value of sensor white is: %.0f", white);
|
||||
ESP_LOGD("VEML7700", "The value of sensor ALS is: %.0f", als);
|
||||
lux_sensor->publish_state(lux);
|
||||
white_sensor->publish_state(white);
|
||||
als_sensor->publish_state(als);
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user