Fixes to feature update for Internal Temperature usermod

- Updated all doubles to floating-point literals by adding explicit `f` suffix

- Removed all remaining html from readme markdown documentation.
This commit is contained in:
Adam Matthews 2024-06-28 15:47:54 +01:00
parent 9877e899e0
commit a1dfdced31
2 changed files with 10 additions and 9 deletions

View File

@ -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`
<br><br>
## 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)
<br><br>
## 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')
<br><br>
## Installation
- Add a build flag `-D USERMOD_INTERNAL_TEMPERATURE` to your `platformio.ini` (or `platformio_override.ini`).
<br><br>
## 📝 Change Log
@ -35,7 +36,7 @@
2023-09-01
* "Internal Temperature" usermod created
<br><br>
## Authors
- Soeren Willrodt [@lost-hope](https://github.com/lost-hope)

View File

@ -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[];