1#ifndef SENSESP_TRANSFORMS_CLICK_TYPE_H_
2#define SENSESP_TRANSFORMS_CLICK_TYPE_H_
4#include <elapsedMillis.h>
51 ClickType(
const String& config_path =
"", uint16_t long_click_delay = 1300,
52 uint16_t double_click_interval = 400,
53 uint16_t ultra_long_click_delay = 5000);
62 virtual void set(
const bool& input)
override;
63 virtual bool to_json(JsonObject& root)
override;
64 virtual bool from_json(
const JsonObject& config)
override;
ClickType is a transform that consumes button clicks and translates them as events of type ClickTypes...
void emitDelayed(ClickTypes value)
elapsedMillis press_duration_
Timmer to time button presses.
virtual bool from_json(const JsonObject &config) override
elapsedMillis release_duration_
Timer to time interval between button releases.
uint16_t long_click_delay_
void on_ultra_long_click()
reactesp::DelayEvent * delayed_click_report_
uint16_t double_click_interval_
ClickType(const String &config_path="", uint16_t long_click_delay=1300, uint16_t double_click_interval=400, uint16_t ultra_long_click_delay=5000)
virtual void set(const bool &input) override
void on_button_press()
Processes incoming values that represent a "ButonPress" event.
void on_button_release()
Processes incoming value that represent a "ButtonRelease" event.
void on_click_completed()
static bool is_click(ClickTypes value)
virtual bool to_json(JsonObject &root) override
uint16_t ultra_long_click_delay_
const String ConfigSchema(const SmartSwitchController &obj)