Activate some clang-tidy checks (#1884)

This commit is contained in:
Otto Winter
2021-06-10 13:04:40 +02:00
committed by GitHub
parent eb9bd69405
commit 360effcb72
109 changed files with 458 additions and 422 deletions
+3 -3
View File
@@ -8,7 +8,7 @@ static const char *TAG = "tuya.light";
void TuyaLight::setup() {
if (this->color_temperature_id_.has_value()) {
this->parent_->register_listener(*this->color_temperature_id_, [this](TuyaDatapoint datapoint) {
this->parent_->register_listener(*this->color_temperature_id_, [this](const TuyaDatapoint &datapoint) {
auto call = this->state_->make_call();
call.set_color_temperature(this->cold_white_temperature_ +
(this->warm_white_temperature_ - this->cold_white_temperature_) *
@@ -17,14 +17,14 @@ void TuyaLight::setup() {
});
}
if (this->dimmer_id_.has_value()) {
this->parent_->register_listener(*this->dimmer_id_, [this](TuyaDatapoint datapoint) {
this->parent_->register_listener(*this->dimmer_id_, [this](const TuyaDatapoint &datapoint) {
auto call = this->state_->make_call();
call.set_brightness(float(datapoint.value_uint) / this->max_value_);
call.perform();
});
}
if (switch_id_.has_value()) {
this->parent_->register_listener(*this->switch_id_, [this](TuyaDatapoint datapoint) {
this->parent_->register_listener(*this->switch_id_, [this](const TuyaDatapoint &datapoint) {
auto call = this->state_->make_call();
call.set_state(datapoint.value_bool);
call.perform();