Skip to content

Commit

Permalink
Fixes to feature update for Internal Temperature usermod
Browse files Browse the repository at this point in the history
- Updated all doubles to floating-point literals by adding explicit `f` suffix

- Removed all remaining html from readme markdown documentation.
  • Loading branch information
adamsthws committed Jun 28, 2024
1 parent 9877e89 commit a1dfdce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
13 changes: 7 additions & 6 deletions usermods/Internal_Temperature_v2/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -35,7 +36,7 @@
2023-09-01

* "Internal Temperature" usermod created
<br><br>


## Authors
- Soeren Willrodt [@lost-hope](https://github.com/lost-hope)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ class InternalTemperatureUsermod : public Usermod
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[];
Expand Down

0 comments on commit a1dfdce

Please sign in to comment.