Add _all entries for esp32 16MB with lots of usermods

platformio: add _all entries with a lot of usermods
usermod bh1750 and bme280: avoid global pin hijacking
settings.htm: remove height for compact display
This commit is contained in:
Ewoud
2023-01-08 16:07:02 +01:00
parent 544446d35e
commit a10f1b20ac
6 changed files with 101 additions and 88 deletions

View File

@@ -240,7 +240,7 @@ public:
top[FPSTR(_HomeAssistantDiscovery)] = HomeAssistantDiscovery;
top[FPSTR(_offset)] = offset;
JsonArray io_pin = top.createNestedArray(F("pin"));
//WLEDMM: Only save if not same as global
//WLEDMM: avoid global pin hijacking
io_pin.add((ioPin[0]==i2c_scl)?-1:ioPin[0]);
io_pin.add((ioPin[1]==i2c_sda)?-1:ioPin[1]);

View File

@@ -412,7 +412,9 @@ public:
top[F("UseCelsius")] = UseCelsius;
top[F("HomeAssistantDiscovery")] = HomeAssistantDiscovery;
JsonArray io_pin = top.createNestedArray(F("pin"));
for (byte i=0; i<2; i++) io_pin.add(ioPin[i]);
//WLEDMM: avoid global pin hijacking
io_pin.add((ioPin[0]==i2c_scl)?-1:ioPin[0]);
io_pin.add((ioPin[1]==i2c_sda)?-1:ioPin[1]);
top[F("help4Pins")] = F("SCL,SDA"); // help for Settings page
DEBUG_PRINTLN(F("BME280 config saved."));
}

View File

@@ -639,6 +639,7 @@ class FourLineDisplayUsermod : public Usermod {
JsonObject top = root.createNestedObject(FPSTR(_name));
top[FPSTR(_enabled)] = enabled;
JsonArray io_pin = top.createNestedArray("pin");
#warning WLEDMM: this causes global pin hijacking
for (byte i=0; i<5; i++) io_pin.add(ioPin[i]);
top["help4Pins"] = F("Clk,Data,CS,DC,RST"); // help for Settings page
top["type"] = type;