Convert usermods from header to library

This commit is contained in:
Will Tatam 2025-01-11 21:42:41 +00:00
parent a5575bc3a0
commit 6e76a72d78
32 changed files with 208 additions and 4 deletions

View File

@ -252,4 +252,7 @@ class ADS1115Usermod : public Usermod {
int16_t results = ads.getLastConversionResults(); int16_t results = ads.getLastConversionResults();
readings[activeChannel] = ads.computeVolts(results); readings[activeChannel] = ads.computeVolts(results);
} }
}; };
static ADS1115Usermod ads1115_v2;
REGISTER_USERMOD(ads1115_v2);

View File

@ -0,0 +1,9 @@
{
"name:": "ADS1115_v2",
"build": {
"srcDir": ".",
"includeDir": "../../wled00",
"libLDFMode": "chain+",
"libArchive": false
}
}

View File

@ -324,4 +324,7 @@ public:
} }
}; };
const char UsermodAHT10::_name[] PROGMEM = "AHTxx"; const char UsermodAHT10::_name[] PROGMEM = "AHTxx";
static UsermodAHT10 aht10_v2;
REGISTER_USERMOD(aht10_v2);

View File

@ -0,0 +1,9 @@
{
"name:": "AHT10_v2",
"build": {
"srcDir": ".",
"includeDir": "../../wled00",
"libLDFMode": "chain+",
"libArchive": false
}
}

View File

@ -250,3 +250,7 @@ const char Usermod_BH1750::_maxReadInterval[] PROGMEM = "max-read-interval-ms";
const char Usermod_BH1750::_minReadInterval[] PROGMEM = "min-read-interval-ms"; const char Usermod_BH1750::_minReadInterval[] PROGMEM = "min-read-interval-ms";
const char Usermod_BH1750::_HomeAssistantDiscovery[] PROGMEM = "HomeAssistantDiscoveryLux"; const char Usermod_BH1750::_HomeAssistantDiscovery[] PROGMEM = "HomeAssistantDiscoveryLux";
const char Usermod_BH1750::_offset[] PROGMEM = "offset-lx"; const char Usermod_BH1750::_offset[] PROGMEM = "offset-lx";
static Usermod_BH1750 bh1750_v2;
REGISTER_USERMOD(bh1750_v2);

View File

@ -0,0 +1,9 @@
{
"name:": "BH1750_v2",
"build": {
"srcDir": ".",
"includeDir": "../../wled00",
"libLDFMode": "chain+",
"libArchive": false
}
}

View File

@ -479,3 +479,7 @@ public:
const char UsermodBME280::_name[] PROGMEM = "BME280/BMP280"; const char UsermodBME280::_name[] PROGMEM = "BME280/BMP280";
const char UsermodBME280::_enabled[] PROGMEM = "enabled"; const char UsermodBME280::_enabled[] PROGMEM = "enabled";
static UsermodBME280 bme280_v2;
REGISTER_USERMOD(bme280_v2);

View File

@ -0,0 +1,9 @@
{
"name:": "BME280_v2",
"build": {
"srcDir": ".",
"includeDir": "../../wled00",
"libLDFMode": "chain+",
"libArchive": false
}
}

View File

@ -1112,3 +1112,7 @@ void UsermodBME68X::saveState() {
if (WLED_MQTT_CONNECTED) mqtt->publish(charbuffer, 0, false, contbuffer); if (WLED_MQTT_CONNECTED) mqtt->publish(charbuffer, 0, false, contbuffer);
} }
} }
static UsermodBME68X bme68x_v2;
REGISTER_USERMOD(bme68x_v2);

View File

@ -0,0 +1,9 @@
{
"name:": "BME68X_v2",
"build": {
"srcDir": ".",
"includeDir": "../../wled00",
"libLDFMode": "chain+",
"libArchive": false
}
}

View File

@ -554,3 +554,7 @@ public:
}; };
const char UsermodINA226::_name[] PROGMEM = "INA226"; const char UsermodINA226::_name[] PROGMEM = "INA226";
static UsermodINA226 ina226_v2;
REGISTER_USERMOD(ina226_v2);

View File

@ -0,0 +1,9 @@
{
"name:": "INA226_v2",
"build": {
"srcDir": ".",
"includeDir": "../../wled00",
"libLDFMode": "chain+",
"libArchive": false
}
}

View File

@ -193,4 +193,7 @@ void InternalTemperatureUsermod::publishMqtt(const char *state, bool retain)
mqtt->publish(subuf, 0, retain, state); mqtt->publish(subuf, 0, retain, state);
} }
#endif #endif
} }
static InternalTemperatureUsermod internal_temperature_v2;
REGISTER_USERMOD(internal_temperature_v2);

View File

@ -0,0 +1,9 @@
{
"name:": "Internal_Temperature_v2",
"build": {
"srcDir": ".",
"includeDir": "../../wled00",
"libLDFMode": "chain+",
"libArchive": false
}
}

View File

@ -235,3 +235,7 @@ void LD2410Usermod::publishMqtt(const char* topic, const char* state, bool retai
} }
#endif #endif
} }
static LD2410Usermod ld2410_v2;
REGISTER_USERMOD(ld2410_v2);

View File

@ -0,0 +1,9 @@
{
"name:": "LD2410_v2",
"build": {
"srcDir": ".",
"includeDir": "../../wled00",
"libLDFMode": "chain+",
"libArchive": false
}
}

View File

@ -279,3 +279,7 @@ const char Usermod_MAX17048::_enabled[] PROGMEM = "enabled";
const char Usermod_MAX17048::_maxReadInterval[] PROGMEM = "max-read-interval-ms"; const char Usermod_MAX17048::_maxReadInterval[] PROGMEM = "max-read-interval-ms";
const char Usermod_MAX17048::_minReadInterval[] PROGMEM = "min-read-interval-ms"; const char Usermod_MAX17048::_minReadInterval[] PROGMEM = "min-read-interval-ms";
const char Usermod_MAX17048::_HomeAssistantDiscovery[] PROGMEM = "HomeAssistantDiscovery"; const char Usermod_MAX17048::_HomeAssistantDiscovery[] PROGMEM = "HomeAssistantDiscovery";
static Usermod_MAX17048 max17048_v2;
REGISTER_USERMOD(max17048_v2);

View File

@ -0,0 +1,9 @@
{
"name:": "MAX17048_v2",
"build": {
"srcDir": ".",
"includeDir": "../../wled00",
"libLDFMode": "chain+",
"libArchive": false
}
}

View File

@ -42,4 +42,7 @@ class MY9291Usermod : public Usermod {
uint16_t getId() { uint16_t getId() {
return USERMOD_ID_MY9291; return USERMOD_ID_MY9291;
} }
}; };
static MY9291Usermod my9291;
REGISTER_USERMOD(my9291);

View File

@ -0,0 +1,9 @@
{
"name:": "MY9291",
"build": {
"srcDir": ".",
"includeDir": "../../wled00",
"libLDFMode": "chain+",
"libArchive": false
}
}

View File

@ -250,3 +250,7 @@ public:
return USERMOD_ID_TETRISAI; return USERMOD_ID_TETRISAI;
} }
}; };
static TetrisAIUsermod tetrisai_v2;
REGISTER_USERMOD(tetrisai_v2);

View File

@ -0,0 +1,9 @@
{
"name:": "TetrisAI_v2",
"build": {
"srcDir": ".",
"includeDir": "../../wled00",
"libLDFMode": "chain+",
"libArchive": false
}
}

View File

@ -0,0 +1,9 @@
{
"name:": "mqtt_switch_v2",
"build": {
"srcDir": ".",
"includeDir": "../../wled00",
"libLDFMode": "chain+",
"libArchive": false
}
}

View File

@ -157,3 +157,7 @@ inline void UsermodMqttSwitch::updateState(uint8_t pinNr)
mqtt->publish(buf, 0, false, "OFF"); mqtt->publish(buf, 0, false, "OFF");
} }
} }
static UsermodMqttSwitc mqtt_switch_v2;
REGISTER_USERMOD(mqtt_switch_v2);

View File

@ -0,0 +1,9 @@
{
"name:": "sensors_to_mqtt",
"build": {
"srcDir": ".",
"includeDir": "../../wled00",
"libLDFMode": "chain+",
"libArchive": false
}
}

View File

@ -276,3 +276,7 @@ public:
} }
} }
}; };
static UserMod_SensorsToMQTT sensors_to_mqtt;
REGISTER_USERMOD(sensors_to_mqtt);

View File

@ -0,0 +1,9 @@
{
"name:": "seven_segment_display_reloaded",
"build": {
"srcDir": ".",
"includeDir": "../../wled00",
"libLDFMode": "chain+",
"libArchive": false
}
}

View File

@ -571,3 +571,7 @@ const char UsermodSSDR::_str_years[] PROGMEM = "LED-Numbers-Year";
const char UsermodSSDR::_str_ldrEnabled[] PROGMEM = "enable-auto-brightness"; const char UsermodSSDR::_str_ldrEnabled[] PROGMEM = "enable-auto-brightness";
const char UsermodSSDR::_str_minBrightness[] PROGMEM = "auto-brightness-min"; const char UsermodSSDR::_str_minBrightness[] PROGMEM = "auto-brightness-min";
const char UsermodSSDR::_str_maxBrightness[] PROGMEM = "auto-brightness-max"; const char UsermodSSDR::_str_maxBrightness[] PROGMEM = "auto-brightness-max";
static UsermodSSDR seven_segment_display_reloaded;
REGISTER_USERMOD(seven_segment_display_reloaded);

View File

@ -0,0 +1,9 @@
{
"name:": "stairway_wipe_basic",
"build": {
"srcDir": ".",
"includeDir": "../../wled00",
"libLDFMode": "chain+",
"libArchive": false
}
}

View File

@ -126,3 +126,7 @@ void setup() {
//More methods can be added in the future, this example will then be extended. //More methods can be added in the future, this example will then be extended.
//Your usermod will remain compatible as it does not need to implement all methods from the Usermod base class! //Your usermod will remain compatible as it does not need to implement all methods from the Usermod base class!
}; };
static StairwayWipeUsermod stairway_wipe_basic;
REGISTER_USERMOD(stairway_wipe_basic);

View File

@ -0,0 +1,9 @@
{
"name:": "word-clock-matrix",
"build": {
"srcDir": ".",
"includeDir": "../../wled00",
"libLDFMode": "chain+",
"libArchive": false
}
}

View File

@ -336,3 +336,7 @@ public:
}; };
static WordClockMatrix word-clock-matrix;
REGISTER_USERMOD(word-clock-matrix);