From 60891b4d0125699cecec1a667b2629c9e8ad72e1 Mon Sep 17 00:00:00 2001 From: steve Date: Sat, 28 Aug 2021 15:31:05 +1000 Subject: [PATCH] Add safety clause to reading modes --- esphome/components/ltr390/ltr390.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/ltr390/ltr390.cpp b/esphome/components/ltr390/ltr390.cpp index cb1fdf3e8c..4388b0c41e 100644 --- a/esphome/components/ltr390/ltr390.cpp +++ b/esphome/components/ltr390/ltr390.cpp @@ -155,7 +155,7 @@ void LTR390Component::setup() { void LTR390Component::dump_config() { LOG_I2C_DEVICE(this); } void LTR390Component::update() { - if (!this->reading_) { + if (!this->reading_ && mode_funcs_.size() > 0) { this->reading_ = true; this->read_mode_(0); }