New switch input mode: Activation Once #1353
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new input mode called "Activation Once". This mode is designed to work with external timers or sensors, allowing the device to be turned on once and then automatically turned off after a pre-configured duration, regardless of further input changes.
The changes include:
fs_src/index.html
file to add the "Activation Once" option to the input mode selection in the device's web interface.mos.yml
configuration schema to include the new input mode option.InMode
enum insrc/shelly_common.hpp
to include thekActivationOnce
value.src/shelly_hap_light_bulb.cpp
andsrc/shelly_switch.cpp
to handle input events according to the new mode's logic.docs/input-modes.md
that explains the different input modes available for Shelly devices, including the new "Activation Once" mode.The "Activation Once" mode is useful for scenarios where a device needs to be turned on at a specific time (e.g., via an external timer) and then turned off automatically after a set period, without being affected by subsequent input changes. This can be beneficial for applications such as pool pumps, garden lights, or other timed events where manual override from the app is also desired.
As an example consider a pool pump, with an external timer to turn it on at 15:00 every day (a setting
of the external timer) and run for 2 hours (a setting of the internal auto-off timer), but you want to be able to
override the external timer from the app on demand (manually start early at 14:00) and when the external timer kicks in, you don't want it to restart the auto-off timer like in "Activation" mode.