diff --git a/usermods/Internal_Temperature_v2/readme.md b/usermods/Internal_Temperature_v2/readme.md index 8829691ee..d574f3abf 100644 --- a/usermods/Internal_Temperature_v2/readme.md +++ b/usermods/Internal_Temperature_v2/readme.md @@ -4,26 +4,27 @@ ![Screenshot of WLED usermod settings page](assets/screenshot_settings.png) + ## Features - -  🌡️  Adds the internal temperature readout of the chip to the `Info` tab + - 🌡️ Adds the internal temperature readout of the chip to the `Info` tab - 🥵 High temperature indicator/action. (Configurable threshold and preset) - 📣 Publishes the internal temperature over the MQTT topic: `mcutemp` -

+ ## Use Examples - Warn of excessive/damaging temperatures by the triggering of a 'warning' preset - Activate a cooling fan (when used with the multi-relay usermod) -

+ ## Compatibility - A shown temp of 53,33°C might indicate that the internal temp is not supported - ESP8266 does not have a internal temp sensor -> Disabled (Indicated with a readout of '-1') - ESP32S2 seems to crash on reading the sensor -> Disabled (Indicated with a readout of '-1') -

+ ## Installation - Add a build flag `-D USERMOD_INTERNAL_TEMPERATURE` to your `platformio.ini` (or `platformio_override.ini`). -

+ ## 📝 Change Log @@ -35,7 +36,7 @@ 2023-09-01 * "Internal Temperature" usermod created -

+ ## Authors - Soeren Willrodt [@lost-hope](https://github.com/lost-hope) diff --git a/usermods/Internal_Temperature_v2/usermod_internal_temperature.h b/usermods/Internal_Temperature_v2/usermod_internal_temperature.h index 3fa9c4bb1..09f4ba250 100644 --- a/usermods/Internal_Temperature_v2/usermod_internal_temperature.h +++ b/usermods/Internal_Temperature_v2/usermod_internal_temperature.h @@ -10,10 +10,10 @@ private: unsigned long loopInterval = 10000; unsigned long lastTime = 0; bool isEnabled = false; - float temperature = 0; - int presetToActivate = 0; // Preset to activate when temp goes above threshold (0 = disabled) + float temperature = 0.0f; + uint8_t presetToActivate = 0; // Preset to activate when temp goes above threshold (0 = disabled) float activationThreshold = 95.0f; // Temperature threshold to trigger high-temperature actions - float resetMargin = 2.0; // Margin below the activation threshold (Prevents frequent toggling when close to threshold) + float resetMargin = 2.0f; // Margin below the activation threshold (Prevents frequent toggling when close to threshold) bool isAboveThreshold = false; // Flag to track if the high temperature preset is currently active static const char _name[];