supla-device
Toggle main menu visibility
Loading...
Searching...
No Matches
src
supla
network
html
channel_function_parameters.h
1
/*
2
Copyright (C) AC SOFTWARE SP. Z O.O
3
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public License
6
as published by the Free Software Foundation; either version 2
7
of the License, or (at your option) any later version.
8
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
13
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
*/
18
19
#ifndef SRC_SUPLA_NETWORK_HTML_CHANNEL_FUNCTION_PARAMETERS_H_
20
#define SRC_SUPLA_NETWORK_HTML_CHANNEL_FUNCTION_PARAMETERS_H_
21
22
#include <stdint.h>
23
#include <supla/network/html_element.h>
24
25
namespace
Supla {
26
class
Channel
;
27
class
Element
;
28
class
WebSender
;
29
30
namespace
Control {
31
class
RelayRollerShutterPair
;
32
}
33
34
namespace
Html {
35
36
class
ChannelFunctionParameters :
public
HtmlElement {
37
public
:
38
enum class
ChannelScope {
39
Primary,
40
Secondary,
41
Both,
42
};
43
44
explicit
ChannelFunctionParameters(
45
Supla::Element
*element,
46
const
char
*primaryLabel =
nullptr
,
47
const
char
*secondaryLabel =
nullptr
);
48
explicit
ChannelFunctionParameters(
49
Supla::Control::RelayRollerShutterPair
*pair,
50
const
char
*primaryLabel =
nullptr
,
51
const
char
*secondaryLabel =
nullptr
,
52
ChannelScope channelScope = ChannelScope::Both);
53
ChannelFunctionParameters(
Supla::Control::RelayRollerShutterPair
*pair,
54
ChannelScope channelScope);
55
virtual
~ChannelFunctionParameters();
56
57
void
send(
Supla::WebSender
*sender)
override
;
58
bool
handleResponse(
const
char
*key,
const
char
*value)
override
;
59
60
static
void
renderSelectField(
Supla::WebSender
*sender,
61
Supla::Channel
*channel,
62
const
char
*key,
63
const
char
*label);
64
65
private
:
66
static
bool
isKnownSelectableFunction(uint32_t function);
67
static
bool
renderOptions(
Supla::WebSender
*sender,
68
Supla::Channel
*channel);
69
70
bool
handleSingleChannelResponse(
const
char
*key,
71
const
char
*value,
72
Supla::Channel
*channel);
73
bool
handlePairResponse(
const
char
*key,
const
char
*value);
74
75
Supla::Element
*element =
nullptr
;
76
Supla::Control::RelayRollerShutterPair
*pair =
nullptr
;
77
const
char
*primaryLabel =
nullptr
;
78
const
char
*secondaryLabel =
nullptr
;
79
ChannelScope channelScope = ChannelScope::Both;
80
};
81
82
};
// namespace Html
83
};
// namespace Supla
84
85
#endif
// SRC_SUPLA_NETWORK_HTML_CHANNEL_FUNCTION_PARAMETERS_H_
Supla::Channel
Definition
channel.h:33
Supla::Control::RelayRollerShutterPair
Definition
relay_roller_shutter_pair.h:92
Supla::Element
Base class for all elements of SuplaDevice.
Definition
element.h:42
Supla::WebSender
Definition
web_sender.h:175
Generated by
1.17.0