supla-device
Loading...
Searching...
No Matches
custom_checkbox_parameter.h
1// SPDX-FileCopyrightText: AC SOFTWARE SP. Z O.O.
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#ifndef SRC_SUPLA_NETWORK_HTML_CUSTOM_CHECKBOX_PARAMETER_H_
5#define SRC_SUPLA_NETWORK_HTML_CUSTOM_CHECKBOX_PARAMETER_H_
6
7#include <supla/network/html_element.h>
8#include <stdint.h>
9
10namespace Supla {
11
12namespace Html {
13
14/* This HTML Element provides input in config mode for integer value.
15 * You have to provide paramTag under which provided value will be stored
16 * in Supla::Storage::Config.
17 * paramLabel provides label which is displayed next to input in www.
18 */
19
20#define MAX_LABEL_SIZE 500
21
23 public:
24 CustomCheckboxParameter(const char *paramTag,
25 const char *paramLabel,
26 uint8_t defaultValue = 0);
28 void send(Supla::WebSender* sender) override;
29 bool handleResponse(const char* key, const char* value) override;
30 void onProcessingEnd() override;
31
32 void setTag(const char *tagValue);
33 void setLabel(const char *labelValue);
34
35 protected:
36 char *tag = nullptr;
37 char *label = nullptr;
38 uint8_t checkboxValue;
39 bool checkboxFound = false;
40};
41
42}; // namespace Html
43}; // namespace Supla
44
45#endif // SRC_SUPLA_NETWORK_HTML_CUSTOM_CHECKBOX_PARAMETER_H_
Definition html_element.h:22
Definition custom_checkbox_parameter.h:22
Definition web_sender.h:160