SensESP 2.7.2
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
smart_switch_controller.h
Go to the documentation of this file.
1#ifndef _smart_switch_controller_h
2#define _smart_switch_controller_h
3
7
8namespace sensesp {
9
44 public ValueConsumer<ClickTypes>,
45 public ValueConsumer<String> {
46 public:
63 const char* sk_sync_paths[] = NULL);
64 void start() override;
65 void set_input(bool new_value, uint8_t input_channel = 0) override;
68
69 // For reading and writing the configuration of this transformation
70 virtual void get_configuration(JsonObject& doc) override;
71 virtual bool set_configuration(const JsonObject& config) override;
72 virtual String get_config_schema() override;
73
74 public:
76 class SyncPath {
77 public:
80
81 SyncPath();
83
84 friend bool operator<(const SyncPath& lhs, const SyncPath& rhs) {
85 return lhs.sk_sync_path < rhs.sk_sync_path;
86 }
87 };
88
89 protected:
90 bool is_on = false;
92 std::set<SyncPath> sync_paths;
93};
94
95} // namespace sensesp
96
97#endif
Construct a new transform based on a single function.
Used to store configuration internally.
friend bool operator<(const SyncPath &lhs, const SyncPath &rhs)
A high level transform designed to control a digital output (such as a relay) via manual button press...
void set_input(bool new_value, uint8_t input_channel=0) override
virtual void get_configuration(JsonObject &doc) override
virtual bool set_configuration(const JsonObject &config) override
virtual String get_config_schema() override
A common type of transform that consumes, transforms, then outputs values of the same data type.
Definition transform.h:95
A base class for piece of code (like a transform) that accepts data for input. ValueConsumers can acc...