Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit df20d6a

Browse files
Fabrizio Mirabitoaentinger
Fabrizio Mirabito
authored andcommitted
Add getters and setters to automation types
1 parent 2ae6741 commit df20d6a

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

src/types/automation/CloudColoredLight.h

+32
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,38 @@ class CloudColoredLight : public CloudColor {
7676
return _value;
7777
}
7878

79+
bool getSwitch() {
80+
return _value.swi;
81+
}
82+
83+
void setSwitch(bool const swi) {
84+
_value.swi = swi;
85+
}
86+
87+
float getHue() {
88+
return _value.hue;
89+
}
90+
91+
void setHue(float const hue) {
92+
_value.hue = hue;
93+
}
94+
95+
float getSaturation() {
96+
return _value.sat;
97+
}
98+
99+
void setSaturation(float const sat) {
100+
_value.sat = sat;
101+
}
102+
103+
float getBrightness() {
104+
return _value.bri;
105+
}
106+
107+
void setBrightness(float const bri) {
108+
_value.bri = bri;
109+
}
110+
79111
virtual void fromCloudToLocal() {
80112
_value = _cloud_value;
81113
}

src/types/automation/CloudDimmeredLight.h

+16
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,22 @@ class CloudDimmeredLight : public ArduinoCloudProperty {
7575
return _value;
7676
}
7777

78+
float getBrightness() {
79+
return _value.bri;
80+
}
81+
82+
void setBrightness(float const bri) {
83+
_value.bri = bri;
84+
}
85+
86+
bool getSwitch() {
87+
return _value.swi;
88+
}
89+
90+
void setSwitch(bool const swi) {
91+
_value.swi = swi;
92+
}
93+
7894
virtual void fromCloudToLocal() {
7995
_value = _cloud_value;
8096
}

0 commit comments

Comments
 (0)