mirror of
https://github.com/esphome/esphome.git
synced 2024-11-14 02:58:11 +01:00
changed color temp from float to int (#1522)
* changed color temp from float to int Changed cold_white_temperature and warm_white temperature from a float to an integer. This makes home assisting show it correctly in the color temperature slider. If it is set to float home assistant show something like 470.8390000283847829304845 in the slider which provides an ugly ui and color temperature to as a decimal is invalid anyway. * Update esphome/components/rgbww/light.py * Update esphome/components/rgbww/light.py Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
This commit is contained in:
parent
8e93735861
commit
c5dc736c53
1 changed files with 4 additions and 4 deletions
|
@ -14,8 +14,8 @@ class RGBWWLightOutput : public light::LightOutput {
|
|||
void set_blue(output::FloatOutput *blue) { blue_ = blue; }
|
||||
void set_cold_white(output::FloatOutput *cold_white) { cold_white_ = cold_white; }
|
||||
void set_warm_white(output::FloatOutput *warm_white) { warm_white_ = warm_white; }
|
||||
void set_cold_white_temperature(float cold_white_temperature) { cold_white_temperature_ = cold_white_temperature; }
|
||||
void set_warm_white_temperature(float warm_white_temperature) { warm_white_temperature_ = warm_white_temperature; }
|
||||
void set_cold_white_temperature(int cold_white_temperature) { cold_white_temperature_ = cold_white_temperature; }
|
||||
void set_warm_white_temperature(int warm_white_temperature) { warm_white_temperature_ = warm_white_temperature; }
|
||||
void set_constant_brightness(bool constant_brightness) { constant_brightness_ = constant_brightness; }
|
||||
void set_color_interlock(bool color_interlock) { color_interlock_ = color_interlock; }
|
||||
light::LightTraits get_traits() override {
|
||||
|
@ -46,8 +46,8 @@ class RGBWWLightOutput : public light::LightOutput {
|
|||
output::FloatOutput *blue_;
|
||||
output::FloatOutput *cold_white_;
|
||||
output::FloatOutput *warm_white_;
|
||||
float cold_white_temperature_;
|
||||
float warm_white_temperature_;
|
||||
int cold_white_temperature_;
|
||||
int warm_white_temperature_;
|
||||
bool constant_brightness_;
|
||||
bool color_interlock_{false};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue