From 3b86faa4450fb4f6d60d73bbbe8b25b8fcacd119 Mon Sep 17 00:00:00 2001 From: Toby Date: Sun, 20 Sep 2026 21:12:14 +0200 Subject: [PATCH] lsm6ds: skip reads for disabled sensors --- esphome/components/lsm6ds_base/lsm6ds_base.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/lsm6ds_base/lsm6ds_base.cpp b/esphome/components/lsm6ds_base/lsm6ds_base.cpp index 090c34f33..f0eb4051b 100644 --- a/esphome/components/lsm6ds_base/lsm6ds_base.cpp +++ b/esphome/components/lsm6ds_base/lsm6ds_base.cpp @@ -101,7 +101,7 @@ void LSM6DSComponent::update() { if (!this->read_register(0x1E, &status, 1)) return; - if (status & 0x01) { // GDA - Gyroscope data available + if (this->gyro_odr_ != LSM6DS_ODR_OFF && (status & 0x01)) { // GDA - Gyroscope data available uint8_t data[6]; if (this->read_register(0x22, data, 6)) { int16_t gx = encode_uint16(data[1], data[0]); @@ -116,7 +116,7 @@ void LSM6DSComponent::update() { } } - if (status & 0x02) { // XLDA - Accelerometer data available + if (this->accel_odr_ != LSM6DS_ODR_OFF && (status & 0x02)) { // XLDA - Accelerometer data available uint8_t data[6]; if (this->read_register(0x28, data, 6)) { int16_t ax = encode_uint16(data[1], data[0]);