ESPNode
switch_onoff.h
Go to the documentation of this file.
1 #ifdef USE_SWITCH_ONOFF
2 #ifndef _SWITCH_ONOFF_H_
3 #define _SWITCH_ONOFF_H_
4 /***************************************************************************************
5  ***************************************************************************************/
6 #include "base_generic.h"
7 
17 
18 class Switch_OnOff : public Base_Generic {
19 
20 public:
21 
22  Switch_OnOff();
23 
32  void begin(const char* html_place, const char* label, const char* mqtt_name, const char* keyword,
33  bool start_value, bool on_value, bool is_state);
34 
44  void begin(const char* html_place, const char* label, const char* mqtt_name, const char* keyword,
45  bool start_value, bool on_value, bool is_state, uint8_t hw_pin);
46 
57  void begin(const char* html_place, const char* label, const char* mqtt_name, const char* keyword,
58  bool start_value, bool on_value, bool is_state, uint8_t hw_pin1, uint8_t hw_pin2);
59 
74  void begin(const char* html_place, const char* label, const char* mqtt_name, const char* keyword,
75  bool start_value, bool on_value, bool is_state, uint8_t slider_val, uint8_t slider_max_val, uint8_t slider_no,
76  const char* slider_label, const char* slider_mqtt_name, const char* slider_keyword);
77 
93  void begin(const char* html_place, const char* label, const char* mqtt_name, const char* keyword,
94  bool start_value, bool on_value, bool is_state, uint8_t hw_pin, uint8_t slider_val, uint8_t slider_max_val, uint8_t slider_no,
95  const char* slider_label, const char* slider_mqtt_name, const char* slider_keyword);
96 
106  bool set(const String& _cmnd, const String& _val);
107 
108  void html_init();
109 
112  uint8_t get_slider_val();
113 
116  bool get_switch_val();
117 
120  void set_switch(uint8_t _val);
121 
124  void set_slider(uint8_t _val);
125 
128  void set_slider_label(const char* _label);
129 
132  void set_slider_max_value(uint8_t _val);
133 
136  void do_switch(bool new_state);
137 
138  void set_hw_pin(uint8_t pin1);
139 
140  void set_hw_pin(uint8_t pin1, uint8_t pin2);
141 
143  bool switch_value;
145  bool on_value;
147  bool start_value;
149  bool slider_used = false;
151  String switch_mqtt_name;
153  String slider_mqtt_name;
155  String slider_keyword;
157  String slider_label;
159  uint8_t slider_value;
161  uint8_t slider_max_value;
163  uint8_t slider_no;
165  bool hw_pin1_used = false;
167  bool hw_pin2_used = false;
169  uint8_t hw_pin1;
171  uint8_t hw_pin2;
172 
173 private:
174 
175 };
176 
177 #endif
178 #endif
Ein generisches Objekt für einen Sensor/Actor. Achtung: Nicht zum Einbau bestimmt,...
Definition: base_generic.h:12
bool set(const String &_keyword, const String &_value)
Der Komandointerpreter. Hier als leere Funktion implementiert, kann im abgeleiteten Objekt gefüllt we...
Definition: base_generic.cpp:33
void html_init()
Initialisierung einer Webseite Wenn sich ein Browser verbindet und die Webseite des Nodes aufruft,...
Definition: base_generic.cpp:50
void begin(const char *_html_place, const char *_label)
Legt die Startkonfiguration des Sensors fest. Die übergebenen Variabelen werden in die entsprechenden...
Definition: base_generic.cpp:9