Force braces around multi-line statements (#3094)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Oxan van Leeuwen
2022-01-24 20:56:36 +01:00
committed by GitHub
parent 6b27f2d2cf
commit 80d03a631e
125 changed files with 770 additions and 504 deletions
+9 -6
View File
@@ -71,31 +71,34 @@ void TuyaLight::dump_config() {
ESP_LOGCONFIG(TAG, " Dimmer has datapoint ID %u", *this->dimmer_id_);
if (this->switch_id_.has_value())
ESP_LOGCONFIG(TAG, " Switch has datapoint ID %u", *this->switch_id_);
if (this->rgb_id_.has_value())
if (this->rgb_id_.has_value()) {
ESP_LOGCONFIG(TAG, " RGB has datapoint ID %u", *this->rgb_id_);
else if (this->hsv_id_.has_value())
} else if (this->hsv_id_.has_value()) {
ESP_LOGCONFIG(TAG, " HSV has datapoint ID %u", *this->hsv_id_);
}
}
light::LightTraits TuyaLight::get_traits() {
auto traits = light::LightTraits();
if (this->color_temperature_id_.has_value() && this->dimmer_id_.has_value()) {
if (this->rgb_id_.has_value() || this->hsv_id_.has_value()) {
if (this->color_interlock_)
if (this->color_interlock_) {
traits.set_supported_color_modes({light::ColorMode::RGB, light::ColorMode::COLOR_TEMPERATURE});
else
} else {
traits.set_supported_color_modes(
{light::ColorMode::RGB_COLOR_TEMPERATURE, light::ColorMode::COLOR_TEMPERATURE});
}
} else
traits.set_supported_color_modes({light::ColorMode::COLOR_TEMPERATURE});
traits.set_min_mireds(this->cold_white_temperature_);
traits.set_max_mireds(this->warm_white_temperature_);
} else if (this->rgb_id_.has_value() || this->hsv_id_.has_value()) {
if (this->dimmer_id_.has_value()) {
if (this->color_interlock_)
if (this->color_interlock_) {
traits.set_supported_color_modes({light::ColorMode::RGB, light::ColorMode::WHITE});
else
} else {
traits.set_supported_color_modes({light::ColorMode::RGB_WHITE});
}
} else
traits.set_supported_color_modes({light::ColorMode::RGB});
} else if (this->dimmer_id_.has_value()) {