supla-device
Loading...
Searching...
No Matches
rgbw_base.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_RGBW_BASE_H_
20#define SRC_SUPLA_CONTROL_RGBW_BASE_H_
21
22#include <stdint.h>
23
24#include "rgb_cct_base.h"
25#include "../action_handler.h"
26#include "../channel_element.h"
27
28#define RGBW_STATE_ON_INIT_RESTORE -1
29#define RGBW_STATE_ON_INIT_OFF 0
30#define RGBW_STATE_ON_INIT_ON 1
31
32namespace Supla {
33namespace Control {
34
35class Button;
36
37class RGBWBase : public RGBCCTBase {
38 public:
39 RGBWBase();
40
41 virtual void setRGBWValueOnDevice(uint32_t red,
42 uint32_t green,
43 uint32_t blue,
44 uint32_t colorBrightness,
45 uint32_t whiteBrightness) = 0;
46
47 void setRGBCCTValueOnDevice(uint32_t red,
48 uint32_t green,
49 uint32_t blue,
50 uint32_t colorBrightness,
51 uint32_t white1Brightness,
52 uint32_t white2Brightness) override;
53
54 void onLoadState() override;
55 void onSaveState() override;
56};
57
58}; // namespace Control
59}; // namespace Supla
60
61#endif // SRC_SUPLA_CONTROL_RGBW_BASE_H_
Definition button.h:34
void onSaveState() override
Method called periodically during SuplaDevice iteration.
Definition rgbw_base.cpp:48
void onLoadState() override
Second method called on element in SuplaDevice.begin().
Definition rgbw_base.cpp:71