UM BH1750 adapted to "MM style", 8266 build fixes

* UM BH1750 adjustments to use new MM features
* UM BH1750 check sensor status before tryig to read new value (avoids blocking LED updates)
* UM temperature: ensure that measurements continue with many LEDs running (strip.isUpdating() will be true all the time)
* all usermods: solved compile problems on 8266
This commit is contained in:
Frank
2023-05-10 20:14:10 +02:00
parent 3aad3a8ff7
commit 50061ddae8
4 changed files with 30 additions and 24 deletions

View File

@@ -390,7 +390,7 @@ void ShtUsermod::addToConfig(JsonObject &root)
{
JsonObject top = root.createNestedObject(FPSTR(_name)); // usermodname
top[FPSTR("enabled")] = enabled;
top[F("enabled")] = enabled;
top[FPSTR(_shtType)] = shtType;
top[FPSTR(_unitOfTemp)] = unitOfTemp;
top[FPSTR(_haMqttDiscovery)] = haMqttDiscovery;
@@ -421,7 +421,7 @@ bool ShtUsermod::readFromConfig(JsonObject &root)
byte oldUnitOfTemp = unitOfTemp;
bool oldHaMqttDiscovery = haMqttDiscovery;
getJsonValue(top[FPSTR("enabled")], enabled);
getJsonValue(top[F("enabled")], enabled);
getJsonValue(top[FPSTR(_shtType)], shtType);
getJsonValue(top[FPSTR(_unitOfTemp)], unitOfTemp);
getJsonValue(top[FPSTR(_haMqttDiscovery)], haMqttDiscovery);