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
+4 -4
View File
@@ -13,7 +13,7 @@ void TuyaFan::setup() {
this->fan_->set_traits(traits);
if (this->speed_id_.has_value()) {
this->parent_->register_listener(*this->speed_id_, [this](TuyaDatapoint datapoint) {
this->parent_->register_listener(*this->speed_id_, [this](const TuyaDatapoint &datapoint) {
ESP_LOGV(TAG, "MCU reported speed of: %d", datapoint.value_enum);
auto call = this->fan_->make_call();
if (datapoint.value_enum < this->speed_count_)
@@ -24,7 +24,7 @@ void TuyaFan::setup() {
});
}
if (this->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) {
ESP_LOGV(TAG, "MCU reported switch is: %s", ONOFF(datapoint.value_bool));
auto call = this->fan_->make_call();
call.set_state(datapoint.value_bool);
@@ -32,7 +32,7 @@ void TuyaFan::setup() {
});
}
if (this->oscillation_id_.has_value()) {
this->parent_->register_listener(*this->oscillation_id_, [this](TuyaDatapoint datapoint) {
this->parent_->register_listener(*this->oscillation_id_, [this](const TuyaDatapoint &datapoint) {
ESP_LOGV(TAG, "MCU reported oscillation is: %s", ONOFF(datapoint.value_bool));
auto call = this->fan_->make_call();
call.set_oscillating(datapoint.value_bool);
@@ -40,7 +40,7 @@ void TuyaFan::setup() {
});
}
if (this->direction_id_.has_value()) {
this->parent_->register_listener(*this->direction_id_, [this](TuyaDatapoint datapoint) {
this->parent_->register_listener(*this->direction_id_, [this](const TuyaDatapoint &datapoint) {
auto call = this->fan_->make_call();
call.set_direction(datapoint.value_bool ? fan::FAN_DIRECTION_REVERSE : fan::FAN_DIRECTION_FORWARD);
call.perform();