implement addHB (Usermod help button utility function)

See https://github.com/Aircoookie/WLED/pull/2965
This commit is contained in:
Ewoud
2023-01-07 12:22:29 +01:00
parent 66b15d32d9
commit 2187aa5728
11 changed files with 193 additions and 183 deletions

View File

@@ -414,7 +414,7 @@ class Animated_Staircase : public Usermod {
}
void appendConfigData() {
oappend(SET_F("addInfo('staircase:help',0,'<button onclick=\"location.href=&quot;https://mm.kno.wled.ge/usermods/staircase&quot;\" type=\"button\">?</button>');"));
oappend(SET_F("addHB('")); oappend(SET_F(_name)); oappend("');");
//oappend(SET_F("dd=addDropdown('staircase','selectfield');"));
//oappend(SET_F("addOption(dd,'1st value',0);"));

View File

@@ -221,7 +221,8 @@ public:
}
void appendConfigData() {
oappend(SET_F("addInfo('BH1750:help',0,'<button onclick=\"location.href=&quot;https://mm.kno.wled.ge/usermods/BH1750&quot;\" type=\"button\">?</button>');"));
oappend(SET_F("addHB('")); oappend(SET_F(_name)); oappend("');");
oappend(SET_F("addInfo('BH1750:pin[]',1,'','I2C SDA');"));
oappend(SET_F("rOption('BH1750:pin[]',1,'use global (")); oappendi(i2c_sda); oappend(")',-1);");
oappend(SET_F("addInfo('BH1750:pin[]',0,'','I2C SCL');"));

View File

@@ -378,7 +378,8 @@ class UsermodBattery : public Usermod
void appendConfigData()
{
oappend(SET_F("addInfo('Battery:help',0,'<button onclick=\"location.href=&quot;https://mm.kno.wled.ge/usermods/Battery&quot;\" type=\"button\">?</button>');"));
oappend(SET_F("addHB('")); oappend(SET_F(_name)); oappend("');");
oappend(SET_F("addInfo('Battery:min-voltage', 1, 'v');"));
oappend(SET_F("addInfo('Battery:max-voltage', 1, 'v');"));
oappend(SET_F("addInfo('Battery:capacity', 1, 'mAh');"));

View File

@@ -414,7 +414,7 @@ public:
void appendConfigData()
{
oappend(SET_F("addInfo('PIRsensorSwitch:help',0,'<button onclick=\"location.href=&quot;https://mm.kno.wled.ge/usermods/PIRsensorSwitch&quot;\" type=\"button\">?</button>');"));
oappend(SET_F("addHB('")); oappend(SET_F(_name)); oappend("');");
oappend(SET_F("addInfo('PIRsensorSwitch:HA-discovery',1,'HA=Home Assistant');")); // 0 is field type, 1 is actual field
oappend(SET_F("addInfo('PIRsensorSwitch:notifications',1,'Periodic WS updates');")); // 0 is field type, 1 is actual field

View File

@@ -306,7 +306,7 @@ class UsermodTemperature : public Usermod {
//}
void appendConfigData() {
oappend(SET_F("addInfo('Temperature:help',0,'<button onclick=\"location.href=&quot;https://mm.kno.wled.ge/usermods/Temperature&quot;\" type=\"button\">?</button>');"));
oappend(SET_F("addHB('")); oappend(SET_F(_name)); oappend("');");
}
/**

View File

@@ -303,7 +303,7 @@ class BobLightUsermod : public Usermod {
}
void appendConfigData() {
oappend(SET_F("addInfo('BobLight:help',0,'<button onclick=\"location.href=&quot;https://mm.kno.wled.ge/usermods/BobLight&quot;\" type=\"button\">?</button>');"));
oappend(SET_F("addHB('")); oappend(SET_F(_name)); oappend("');");
//oappend(SET_F("dd=addDropdown('usermod','selectfield');"));
//oappend(SET_F("addOption(dd,'1st value',0);"));

View File

@@ -205,7 +205,7 @@ class AutoSaveUsermod : public Usermod {
}
void appendConfigData() {
oappend(SET_F("addInfo('Autosave:help',0,'<button onclick=\"location.href=&quot;https://mm.kno.wled.ge/usermods/Autosave&quot;\" type=\"button\">?</button>');"));
oappend(SET_F("addHB('")); oappend(SET_F(_name)); oappend("');");
}
/*

View File

@@ -1036,7 +1036,7 @@ class FourLineDisplayUsermod : public Usermod {
//}
void appendConfigData() {
oappend(SET_F("addInfo('4LineDisplay:help',0,'<button onclick=\"location.href=&quot;https://mm.kno.wled.ge/usermods/4LineDisplay&quot;\" type=\"button\">?</button>');"));
oappend(SET_F("addHB('")); oappend(SET_F(_name)); oappend("');");
oappend(SET_F("dd=addDropdown('4LineDisplay','type');"));
oappend(SET_F("addOption(dd,'None',0);"));

View File

@@ -868,7 +868,8 @@ public:
//WLEDMM: add appendConfigData
void appendConfigData()
{
oappend(SET_F("addInfo('Rotary-Encoder:help',0,'<button onclick=\"location.href=&quot;https://mm.kno.wled.ge/usermods/Rotary-Encoder&quot;\" type=\"button\">?</button>');"));
oappend(SET_F("addHB('")); oappend(SET_F(_name)); oappend("');");
#ifdef ENCODER_DT_PIN
oappend(SET_F("xOption('Rotary-Encoder:DT-pin',1,' ⎌',")); oappendi(ENCODER_DT_PIN); oappend(");");
#endif