From 3815516022f495e73ae9f9316704f05231e47b3d Mon Sep 17 00:00:00 2001 From: Adam Matthews Date: Fri, 28 Jun 2024 16:12:56 +0100 Subject: [PATCH] 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. --- .../Internal_Temperature_v2/usermod_internal_temperature.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/usermods/Internal_Temperature_v2/usermod_internal_temperature.h b/usermods/Internal_Temperature_v2/usermod_internal_temperature.h index 09f4ba250..198c4e4eb 100644 --- a/usermods/Internal_Temperature_v2/usermod_internal_temperature.h +++ b/usermods/Internal_Temperature_v2/usermod_internal_temperature.h @@ -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;