From 17c5844d13afe62c52301eabd683cb6913a77c10 Mon Sep 17 00:00:00 2001 From: Tomasz Duda Date: Fri, 9 Aug 2024 17:23:17 +0200 Subject: [PATCH 1/2] base_light_effects lint --- esphome/components/light/base_light_effects.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/light/base_light_effects.h b/esphome/components/light/base_light_effects.h index f7829a3f44..044fff9e96 100644 --- a/esphome/components/light/base_light_effects.h +++ b/esphome/components/light/base_light_effects.h @@ -53,8 +53,8 @@ class PulseLightEffect : public LightEffect { uint32_t transition_on_length_{}; uint32_t transition_off_length_{}; uint32_t update_interval_{}; - float min_brightness{0.0}; - float max_brightness{1.0}; + float min_brightness{0.0}; // NOLINT(readability-identifier-naming) + float max_brightness{1.0}; // NOLINT(readability-identifier-naming) }; /// Random effect. Sets random colors every 10 seconds and slowly transitions between them. From 7ac4a7c5ae79c8739e9d5ab77a80a99c869e434e Mon Sep 17 00:00:00 2001 From: Tomasz Duda Date: Mon, 12 Aug 2024 16:11:09 +0200 Subject: [PATCH 2/2] review comment --- esphome/components/light/base_light_effects.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/esphome/components/light/base_light_effects.h b/esphome/components/light/base_light_effects.h index 044fff9e96..9e02e889c9 100644 --- a/esphome/components/light/base_light_effects.h +++ b/esphome/components/light/base_light_effects.h @@ -25,7 +25,7 @@ class PulseLightEffect : public LightEffect { return; } auto call = this->state_->turn_on(); - float out = this->on_ ? this->max_brightness : this->min_brightness; + float out = this->on_ ? this->max_brightness_ : this->min_brightness_; call.set_brightness_if_supported(out); call.set_transition_length_if_supported(this->on_ ? this->transition_on_length_ : this->transition_off_length_); this->on_ = !this->on_; @@ -43,8 +43,8 @@ class PulseLightEffect : public LightEffect { void set_update_interval(uint32_t update_interval) { this->update_interval_ = update_interval; } void set_min_max_brightness(float min, float max) { - this->min_brightness = min; - this->max_brightness = max; + this->min_brightness_ = min; + this->max_brightness_ = max; } protected: @@ -53,8 +53,8 @@ class PulseLightEffect : public LightEffect { uint32_t transition_on_length_{}; uint32_t transition_off_length_{}; uint32_t update_interval_{}; - float min_brightness{0.0}; // NOLINT(readability-identifier-naming) - float max_brightness{1.0}; // NOLINT(readability-identifier-naming) + float min_brightness_{0.0}; + float max_brightness_{1.0}; }; /// Random effect. Sets random colors every 10 seconds and slowly transitions between them.