supla-device
Loading...
Searching...
No Matches
channel_function_parameters.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_CHANNEL_FUNCTION_PARAMETERS_H_
5#define SRC_SUPLA_NETWORK_HTML_CHANNEL_FUNCTION_PARAMETERS_H_
6
7#include <stdint.h>
8#include <supla/network/html_element.h>
9
10namespace Supla {
11class Channel;
12class Element;
13class WebSender;
14
15namespace Control {
16class RelayRollerShutterPair;
17}
18
19namespace Html {
20
22 public:
23 enum class ChannelScope {
24 Primary,
25 Secondary,
26 Both,
27 };
28
30 Supla::Element *element,
31 const char *primaryLabel = nullptr,
32 const char *secondaryLabel = nullptr);
35 const char *primaryLabel = nullptr,
36 const char *secondaryLabel = nullptr,
37 ChannelScope channelScope = ChannelScope::Both);
39 ChannelScope channelScope);
41
42 void send(Supla::WebSender *sender) override;
43 bool handleResponse(const char *key, const char *value) override;
44
45 static void renderSelectField(Supla::WebSender *sender,
46 Supla::Channel *channel,
47 const char *key,
48 const char *label);
49
50 private:
51 static bool isKnownSelectableFunction(uint32_t function);
52 static bool renderOptions(Supla::WebSender *sender,
53 Supla::Channel *channel);
54
55 bool handleSingleChannelResponse(const char *key,
56 const char *value,
57 Supla::Channel *channel);
58 bool handlePairResponse(const char *key, const char *value);
59
60 Supla::Element *element = nullptr;
62 const char *primaryLabel = nullptr;
63 const char *secondaryLabel = nullptr;
64 ChannelScope channelScope = ChannelScope::Both;
65};
66
67}; // namespace Html
68}; // namespace Supla
69
70#endif // SRC_SUPLA_NETWORK_HTML_CHANNEL_FUNCTION_PARAMETERS_H_
Definition channel.h:26
Definition relay_roller_shutter_pair.h:86
Base class for all elements of SuplaDevice.
Definition element.h:27
Definition html_element.h:22
Definition channel_function_parameters.h:21
Definition web_sender.h:160