From 83f8e8424779f56c1244de4001ac3e9509dfc4fe Mon Sep 17 00:00:00 2001 From: Keith Burzinski Date: Wed, 15 Mar 2023 00:21:23 -0500 Subject: [PATCH] Remove switch actions during config; bump setup priority (#4563) --- esphome/components/sprinkler/sprinkler.cpp | 6 ------ esphome/components/sprinkler/sprinkler.h | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/esphome/components/sprinkler/sprinkler.cpp b/esphome/components/sprinkler/sprinkler.cpp index 9d3044802d..d73d8d8fbf 100644 --- a/esphome/components/sprinkler/sprinkler.cpp +++ b/esphome/components/sprinkler/sprinkler.cpp @@ -477,7 +477,6 @@ void Sprinkler::configure_valve_switch(size_t valve_number, switch_::Switch *val if (this->is_a_valid_valve(valve_number)) { this->valve_[valve_number].valve_switch.set_on_switch(valve_switch); this->valve_[valve_number].run_duration = run_duration; - valve_switch->turn_off(); } } @@ -489,8 +488,6 @@ void Sprinkler::configure_valve_switch_pulsed(size_t valve_number, switch_::Swit this->valve_[valve_number].valve_switch.set_on_switch(valve_switch_on); this->valve_[valve_number].valve_switch.set_pulse_duration(pulse_duration); this->valve_[valve_number].run_duration = run_duration; - valve_switch_off->turn_off(); - valve_switch_on->turn_off(); } } @@ -505,7 +502,6 @@ void Sprinkler::configure_valve_pump_switch(size_t valve_number, switch_::Switch this->pump_.resize(this->pump_.size() + 1); this->pump_.back().set_on_switch(pump_switch); this->valve_[valve_number].pump_switch_index = this->pump_.size() - 1; // save the index to the new pump - pump_switch->turn_off(); } } @@ -524,8 +520,6 @@ void Sprinkler::configure_valve_pump_switch_pulsed(size_t valve_number, switch_: this->pump_.back().set_on_switch(pump_switch_on); this->pump_.back().set_pulse_duration(pulse_duration); this->valve_[valve_number].pump_switch_index = this->pump_.size() - 1; // save the index to the new pump - pump_switch_off->turn_off(); - pump_switch_on->turn_off(); } } diff --git a/esphome/components/sprinkler/sprinkler.h b/esphome/components/sprinkler/sprinkler.h index 1b8c7e4528..1cde60321d 100644 --- a/esphome/components/sprinkler/sprinkler.h +++ b/esphome/components/sprinkler/sprinkler.h @@ -103,7 +103,7 @@ class SprinklerControllerNumber : public number::Number, public Component { public: void setup() override; void dump_config() override; - float get_setup_priority() const override { return setup_priority::HARDWARE; } + float get_setup_priority() const override { return setup_priority::PROCESSOR; } Trigger *get_set_trigger() const { return set_trigger_; } void set_initial_value(float initial_value) { initial_value_ = initial_value; }