1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-27 13:13:50 +00:00

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

View File

@@ -145,10 +145,11 @@ void LightState::publish_state() { this->remote_values_callback_.call(); }
LightOutput *LightState::get_output() const { return this->output_; }
std::string LightState::get_effect_name() {
if (this->active_effect_index_ > 0)
if (this->active_effect_index_ > 0) {
return this->effects_[this->active_effect_index_ - 1]->get_name();
else
} else {
return "None";
}
}
void LightState::add_new_remote_values_callback(std::function<void()> &&send_callback) {
@@ -219,10 +220,11 @@ void LightState::start_effect_(uint32_t effect_index) {
effect->start_internal();
}
LightEffect *LightState::get_active_effect_() {
if (this->active_effect_index_ == 0)
if (this->active_effect_index_ == 0) {
return nullptr;
else
} else {
return this->effects_[this->active_effect_index_ - 1];
}
}
void LightState::stop_effect_() {
auto *effect = this->get_active_effect_();