mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-04 03:48:29 +02:00
Force braces around multi-line statements (#3094)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user