..........................

master
Roman Kretschmer 2 years ago
parent 09c6898a2a
commit 0bd1f33fb9

@ -1,10 +1,10 @@
#pragma once #pragma once
#include "esphome/core/log.h"
#include "esphome/components/i2c/i2c.h" #include "esphome/components/i2c/i2c.h"
#include "esphome/components/light/light_output.h" #include "esphome/components/light/light_output.h"
#include "esphome/components/output/float_output.h" #include "esphome/components/output/float_output.h"
#include "esphome/core/component.h" #include "esphome/core/component.h"
#include "esphome/core/log.h"
namespace esphome { namespace esphome {
namespace c_monochromatic { namespace c_monochromatic {
@ -27,11 +27,13 @@ public:
return traits; return traits;
} }
void write_state(light::LightState *state) override { void write_state(light::LightState *state) override {
if (this->state_ == Off) {
this->light_state_ = state; this->light_state_ = state;
state->current_values_as_brightness(&(this->bright_)); state->current_values_as_brightness(&(this->bright_));
this->upper_->set_level(this->bright_); this->upper_->set_level(this->bright_);
this->lower_->set_level(this->bright_); this->lower_->set_level(this->bright_);
} }
}
void set_state(State s) { void set_state(State s) {
this->state_ = s; this->state_ = s;

Loading…
Cancel
Save