don't check gpio

This commit is contained in:
proddy
2025-11-22 22:36:15 +01:00
parent 2f21d0d94c
commit f307cccabb

View File

@@ -155,13 +155,8 @@ void AnalogSensor::reload(bool get_nvs) {
} }
} }
if (!found) { if (!found) {
// it's new // it's new, we assume it's valid
// check if the GPIO is valid before registering. If not, force set the sensor to disabled, but don't remove it
// should only trigger if uploading a customization file with invalid gpios.
AnalogType type = static_cast<AnalogType>(sensor.type); AnalogType type = static_cast<AnalogType>(sensor.type);
if (!EMSESP::system_.check_valid_gpio(sensor.gpio, "Analog Sensor")) {
continue;
}
sensors_.emplace_back(sensor.gpio, sensor.name, sensor.offset, sensor.factor, sensor.uom, type, sensor.is_system); sensors_.emplace_back(sensor.gpio, sensor.name, sensor.offset, sensor.factor, sensor.uom, type, sensor.is_system);
sensors_.back().ha_registered = false; // this will trigger recreate of the HA config sensors_.back().ha_registered = false; // this will trigger recreate of the HA config