supla-device
Loading...
Searching...
No Matches
rgbw_base.h
1// SPDX-FileCopyrightText: AC SOFTWARE SP. Z O.O.
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#ifndef SRC_SUPLA_CONTROL_RGBW_BASE_H_
5#define SRC_SUPLA_CONTROL_RGBW_BASE_H_
6
7#include <stdint.h>
8
9#include "lighting_pwm_base.h"
10#include "../action_handler.h"
11#include "../channel_element.h"
12
13#define RGBW_STATE_ON_INIT_RESTORE -1
14#define RGBW_STATE_ON_INIT_OFF 0
15#define RGBW_STATE_ON_INIT_ON 1
16
17namespace Supla {
18namespace Control {
19
20class Button;
21
22class RGBWBase : public LightingPwmBase {
23 public:
24 RGBWBase();
25
26 virtual void setRGBWValueOnDevice(uint32_t red,
27 uint32_t green,
28 uint32_t blue,
29 uint32_t whiteBrightness) = 0;
30
31 void setRGBCCTValueOnDevice(uint32_t output[5], int usedOutputs) override;
32
33 void onLoadState() override;
34 void onSaveState() override;
35};
36
37}; // namespace Control
38}; // namespace Supla
39
40#endif // SRC_SUPLA_CONTROL_RGBW_BASE_H_
Definition lighting_pwm_base.h:48
Definition rgbw_base.h:22
void onSaveState() override
Method called periodically during SuplaDevice iteration.
Definition rgbw_base.cpp:33
void onLoadState() override
Second method called on element in SuplaDevice.begin().
Definition rgbw_base.cpp:59