supla-device
Toggle main menu visibility
Loading...
Searching...
No Matches
src
supla
control
group_button_control_rgbw.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_CONTROL_GROUP_BUTTON_CONTROL_RGBW_H_
20
#define SRC_SUPLA_CONTROL_GROUP_BUTTON_CONTROL_RGBW_H_
21
22
#include <supla/action_handler.h>
23
#include <supla/element.h>
24
#include <supla/control/lighting_pwm_base.h>
25
26
#define SUPLA_MAX_GROUP_CONTROL_ELEMENTS 10
27
28
namespace
Supla::Control {
29
30
class
Button
;
31
class
LightingPwmBase
;
32
33
class
GroupButtonControlRgbw :
public
ActionHandler,
public
Element {
34
public
:
35
explicit
GroupButtonControlRgbw(
Button
*button =
nullptr
);
36
void
attach(
Button
*button);
37
void
addToGroup(LightingPwmBase *rgbwElement);
38
39
void
onLoadConfig
(
SuplaDeviceClass
*sdc)
override
;
40
void
onInit
()
override
;
41
void
handleAction(
int
event,
int
action)
override
;
42
43
void
setButtonControlType(
int
rgbwChannelNumber,
44
LightingPwmBase::ButtonControlType type);
45
46
private
:
47
void
handleTurnOn();
48
void
handleTurnOff();
49
void
handleToggle();
50
void
handleIterate();
51
52
Button
*attachedButton =
nullptr
;
53
LightingPwmBase *rgbw[SUPLA_MAX_GROUP_CONTROL_ELEMENTS] = {};
54
LightingPwmBase::ButtonControlType
55
controlType[SUPLA_MAX_GROUP_CONTROL_ELEMENTS] =
56
{};
57
int
rgbwCount = 0;
58
};
59
60
}
// namespace Supla::Control
61
62
#endif
// SRC_SUPLA_CONTROL_GROUP_BUTTON_CONTROL_RGBW_H_
Button
Definition
button.h:34
SuplaDeviceClass
Definition
SuplaDevice.h:163
Supla::Control::Button
Definition
button.h:34
Supla::Control::GroupButtonControlRgbw::onLoadConfig
void onLoadConfig(SuplaDeviceClass *sdc) override
First method called on element in SuplaDevice.begin().
Definition
group_button_control_rgbw.cpp:229
Supla::Control::GroupButtonControlRgbw::onInit
void onInit() override
Third method called on element in SuplaDevice.begin().
Definition
group_button_control_rgbw.cpp:265
Supla::Control::LightingPwmBase
Definition
lighting_pwm_base.h:61
Generated by
1.17.0