diff --git a/usermods/Temperature/usermod_temperature.h b/usermods/Temperature/usermod_temperature.h index af5ce8f3..25968a44 100644 --- a/usermods/Temperature/usermod_temperature.h +++ b/usermods/Temperature/usermod_temperature.h @@ -159,7 +159,7 @@ class UsermodTemperature : public Usermod { #endif public: - UsermodTemperature(const char *name):Usermod(name) {} //WLEDMM: this shouldn't be necessary (passthrough of constructor), maybe because Usermod is an abstract class + UsermodTemperature(const char *name, bool enabled):Usermod(name, enabled) {} //WLEDMM: this shouldn't be necessary (passthrough of constructor), maybe because Usermod is an abstract class void setup() { int retries = 10; diff --git a/usermods/mpu6050_imu/usermod_mpu6050_imu.h b/usermods/mpu6050_imu/usermod_mpu6050_imu.h index 144bc08b..b719643e 100644 --- a/usermods/mpu6050_imu/usermod_mpu6050_imu.h +++ b/usermods/mpu6050_imu/usermod_mpu6050_imu.h @@ -107,7 +107,7 @@ class MPU6050Driver : public Usermod { static const char _INT_pin[]; public: - MPU6050Driver(const char *name):Usermod(name) {} //WLEDMM: this shouldn't be necessary (passthrough of constructor), maybe because Usermod is an abstract class + MPU6050Driver(const char *name, bool enabled):Usermod(name, enabled) {} //WLEDMM: this shouldn't be necessary (passthrough of constructor), maybe because Usermod is an abstract class bool dmpReady = false; // set true if DMP init was successful // WLEDMM expose this info in public interface // orientation/motion vars diff --git a/wled00/fcn_declare.h b/wled00/fcn_declare.h index 16ca7192..6d162dca 100644 --- a/wled00/fcn_declare.h +++ b/wled00/fcn_declare.h @@ -264,7 +264,7 @@ class Usermod { bool enabled = false; //WLEDMM const char *_name; //WLEDMM public: - Usermod(const char *name = nullptr) { um_data = nullptr; _name = name;} + Usermod(const char *_name = nullptr, bool enabled=false) { um_data = nullptr; this->_name = _name; this->enabled=enabled;} virtual ~Usermod() { if (um_data) delete um_data; } virtual void setup() = 0; // pure virtual, has to be overriden virtual void loop() = 0; // pure virtual, has to be overriden diff --git a/wled00/usermods_list.cpp b/wled00/usermods_list.cpp index 8744055f..f9bb62c4 100644 --- a/wled00/usermods_list.cpp +++ b/wled00/usermods_list.cpp @@ -219,7 +219,7 @@ void registerUsermods() #endif #ifdef USERMOD_DALLASTEMPERATURE - usermods.add(new UsermodTemperature("Temperature")); + usermods.add(new UsermodTemperature("Temperature", true)); #endif #ifdef USERMOD_SN_PHOTORESISTOR @@ -385,7 +385,7 @@ void registerUsermods() #ifdef USERMOD_MPU6050_IMU - usermods.add(new MPU6050Driver("mpu6050-IMU")); + usermods.add(new MPU6050Driver("mpu6050-IMU", true)); #endif #ifdef USERMOD_GAMES