Fixes to feature update for Internal Temperature usermod

Simplified the code by removing an unnecessary function definition and instead using direct assignment in the place where the function was previously called.
This commit is contained in:
Adam Matthews 2024-06-28 16:12:56 +01:00
parent a1dfdced31
commit 3815516022

View File

@ -25,11 +25,6 @@ private:
// any private methods should go here (non-inline method should be defined out of class)
void publishMqtt(const char *state, bool retain = false); // example for publishing MQTT message
// Makes sure the measurement interval can't be set too low
void setSafeLoopInterval(unsigned long newInterval) {
loopInterval = max(newInterval, minLoopInterval);
}
public:
void setup()
{
@ -138,7 +133,7 @@ public:
bool configComplete = !top.isNull();
configComplete &= getJsonValue(top[FPSTR(_enabled)], isEnabled);
configComplete &= getJsonValue(top[FPSTR(_loopInterval)], loopInterval);
setSafeLoopInterval(loopInterval); // Makes sure the loop interval isn't too small.
loopInterval = max(loopInterval, minLoopInterval); // Makes sure the loop interval isn't too small.
configComplete &= getJsonValue(top[FPSTR(_presetToActivate)], presetToActivate);
configComplete &= getJsonValue(top[FPSTR(_activationThreshold)], activationThreshold);
return configComplete;