-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usermod Updated: Internal Temperature V2 #4033
Usermod Updated: Internal Temperature V2 #4033
Conversation
# Added high temperature indicator/action... - A configurable preset is activated when the internal temperature raises above a configurable threshold temperature. - When the internal temperature falls back below the threshold, the previously active preset is re-activated. - To prevent frequent toggling between states when the temperature is close to the threshold, the reset threshold is slightly lower than the activation threshold to provide a small buffer. - Reset threshold is automatically calculated to be two degrees lower than whatever the activation threshold is set to. - To prevent the user setting the loop interval too low, a minimum allowable interval has been added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some things that need to be changed.
When you want to temporarily store current preset, you are better of by saving currentPreset
variable. If that is 0 then it is safe to save current state using saveTemporaryPreset()
.
I'd also like to invite @lost-hope to do a peer review.
usermods/Internal_Temperature_v2/usermod_internal_temperature.h
Outdated
Show resolved
Hide resolved
usermods/Internal_Temperature_v2/usermod_internal_temperature.h
Outdated
Show resolved
Hide resolved
usermods/Internal_Temperature_v2/usermod_internal_temperature.h
Outdated
Show resolved
Hide resolved
usermods/Internal_Temperature_v2/usermod_internal_temperature.h
Outdated
Show resolved
Hide resolved
usermods/Internal_Temperature_v2/usermod_internal_temperature.h
Outdated
Show resolved
Hide resolved
usermods/Internal_Temperature_v2/usermod_internal_temperature.h
Outdated
Show resolved
Hide resolved
usermods/Internal_Temperature_v2/usermod_internal_temperature.h
Outdated
Show resolved
Hide resolved
Applied various fixes as advised by @blazoncek Thankyou for the advice! - Updated float: 95.0 > 95.0f - Updated type: const > constexpr - Comments clarified - Preset setting: `-1` > `0`
Github flavoured markdown didn't work as expected.
There ar still a few |
- Updated all doubles to floating-point literals by adding explicit `f` suffix - Removed all remaining html from readme markdown documentation.
Sorry I missed these... Thanyou for being so thorough with your review! |
Simplified the code by removing an unnecessary function definition and instead using direct assignment in the place where the function was previously called.
In addition to storing current preset, if a playlist is active, is it also possible to store the current playlist (and position in playlist?) to resume from the same place later? |
Yes, use |
Enabled the storing the currently active preset or playlist for it to be restored later
This is now implimented, thankyou for your guidance and patience Blaz! |
@lost-hope is this ok with you? |
Yep looks fine to me. |
Hello!
Please may I request to add the following improvement to the usermod: 'Internal Temperature V2'...
Added high temperature indicator/action
A configurable preset is activated when the internal temperature raises above a configurable threshold temperature.
When the internal temperature falls back below the threshold, the previously active playlist/preset/state is re-activated.
If the
preset to trigger
is set to0
, no preset is activated when temperature rises above the threshold.A small temperature buffer prevents frequent toggling between states when the temperature is close to the threshold.
(The reset threshold is automatically calculated to be two degrees lower than whatever the activation threshold is set to).
To prevent the user setting the loop interval too low, a minimum allowable interval has been added.
To do
isAboveThreshold
to MQTT.Thankyou!
Adam Matthews