SensESP 2.7.2
Universal Signal K sensor toolkit ESP32
|
A transform that takes boolean inputs and adds button behaviors familiar to many device end users. More...
#include <sensesp/transforms/press_repeater.h>
Protected Attributes | |
int | integer_false_ |
int | repeat_start_interval_ |
int | repeat_interval_ |
elapsedMillis | last_value_sent_ |
bool | pushed_ |
bool | repeating_ |
Protected Attributes inherited from sensesp::Configurable | |
String | description_ = "" |
int | sort_order_ = 1000 |
Protected Attributes inherited from sensesp::ValueProducer< T > | |
T | output |
Additional Inherited Members | |
Static Public Member Functions inherited from sensesp::TransformBase | |
static const std::set< TransformBase * > & | get_transforms () |
Static Public Member Functions inherited from sensesp::Startable | |
static void | start_all () |
Public Attributes inherited from sensesp::Configurable | |
const String | config_path_ |
Protected Member Functions inherited from sensesp::Configurable | |
virtual void | load_configuration () |
A transform that takes boolean inputs and adds button behaviors familiar to many device end users.
It emits a value only when the state of the input changes (i.e. when the input changes from TRUE to FALSE, and vice versa). In addition, if the input remains TRUE longer than repeat_start_interval milliseconds, it will emit TRUE once again, and then again every repeat_interval milliseconds until the input returns to FALSE.
An example use case would be a DigitalInput connected to a button that represents the "Volume Up" or "Volume Down" of a sound system.
As a convenience for wiring up to DigitalInputValue and other producers that emit integers, PressRepeater can also consume integer values. As long as the integer value coming in does not match integer_false, PressRepeater will act as if TRUE was passed to it.
config_path | The path to configure this transform in Config UI |
integer_false | Whatever integer value (of your input) you want to be the same as boolean "false". Default is 0. |
repeat_start_interval | How long the input must be TRUE before the first repeated output, in ms. Default is 1500. |
repeat_interval | How often to repeat the repeated output, in ms. The default is 250. |
Definition at line 41 of file press_repeater.h.
|
overridevirtual |
Returns a configuration schema that specifies the key/value pairs that can be expected when calling get_configuration(), or are expected by set_configuration(). The schema will be in JSON Schema format
Reimplemented from sensesp::Configurable.
Definition at line 66 of file press_repeater.cpp.
|
overridevirtual |
Returns the current configuration data as a JsonObject. In general, the current state of local member variables are saved to a new object created with JsonDocument::as<JsonObject>() and returned.
Reimplemented from sensesp::Configurable.
Definition at line 53 of file press_repeater.cpp.
|
overridevirtual |
Sets the current state of local member variables using the data stored in config.
Reimplemented from sensesp::Configurable.
Definition at line 68 of file press_repeater.cpp.
|
overridevirtual |
Definition at line 40 of file press_repeater.cpp.
Used to set an input of this consumer. It is usually called automatically by a ValueProducer.
new_value | the value of the input |
input_channel | Consumers can have one or more inputs feeding them. This parameter allows you to specify which input number the producer is connecting to. For single input consumers, leave the index at zero. |
Reimplemented from sensesp::ValueConsumer< int >.
Definition at line 36 of file press_repeater.cpp.
|
overridevirtual |
Called during the initialization process. Override this method to add runtime initialization code to your class
Reimplemented from sensesp::Startable.
Definition at line 16 of file press_repeater.cpp.
|
protected |
Definition at line 56 of file press_repeater.h.
|
protected |
Definition at line 59 of file press_repeater.h.
|
protected |
Definition at line 60 of file press_repeater.h.
|
protected |
Definition at line 58 of file press_repeater.h.
|
protected |
Definition at line 57 of file press_repeater.h.
|
protected |
Definition at line 61 of file press_repeater.h.