SensESP 3.3.0
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
press_repeater.h
Go to the documentation of this file.
1#ifndef SENSESP_TRANSFORMS_PRESS_REPEATER_H_
2#define SENSESP_TRANSFORMS_PRESS_REPEATER_H_
3
4#include <elapsedMillis.h>
5
6#include "ReactESP.h"
10#include "transform.h"
11
12namespace sensesp {
13
45 public:
46 PressRepeater(const String& config_path = "", int integer_false = 0,
47 int repeat_start_interval = 1500, int repeat_interval = 250);
48
49 virtual ~PressRepeater() {
50 if (repeat_event_ != nullptr) {
51 repeat_event_->remove(event_loop());
52 }
53 }
54
55 virtual void set(const bool& new_value) override;
56
57 virtual bool to_json(JsonObject& root) override;
58 virtual bool from_json(const JsonObject& config) override;
59
60 protected:
64 elapsedMillis last_value_sent_;
65 bool pushed_;
67 reactesp::RepeatEvent* repeat_event_ = nullptr;
68};
69
70const String ConfigSchema(const PressRepeater& obj);
71
72} // namespace sensesp
73#endif
A transform that takes boolean inputs and adds button behaviors familiar to many device end users....
virtual bool from_json(const JsonObject &config) override
PressRepeater(const String &config_path="", int integer_false=0, int repeat_start_interval=1500, int repeat_interval=250)
elapsedMillis last_value_sent_
virtual bool to_json(JsonObject &root) override
virtual void set(const bool &new_value) override
reactesp::RepeatEvent * repeat_event_
const String ConfigSchema(const SmartSwitchController &obj)
std::shared_ptr< reactesp::EventLoop > event_loop()
Definition sensesp.cpp:9
SymmetricTransform< bool > BooleanTransform
Definition transform.h:101