mirror of
https://github.com/esphome/esphome.git
synced 2025-10-30 14:43:51 +00:00
Replace std::move() with const references where possible (#2421)
* Replace std::move() with const references where possible * Fix formatting
This commit is contained in:
@@ -13,7 +13,7 @@ class PipsolarOutput : public output::FloatOutput {
|
||||
public:
|
||||
PipsolarOutput() {}
|
||||
void set_parent(Pipsolar *parent) { this->parent_ = parent; }
|
||||
void set_set_command(std::string command) { this->set_command_ = std::move(command); };
|
||||
void set_set_command(const std::string &command) { this->set_command_ = command; };
|
||||
void set_possible_values(std::vector<float> possible_values) { this->possible_values_ = std::move(possible_values); }
|
||||
void set_value(float value) { this->write_state(value); };
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ class Pipsolar;
|
||||
class PipsolarSwitch : public switch_::Switch, public Component {
|
||||
public:
|
||||
void set_parent(Pipsolar *parent) { this->parent_ = parent; };
|
||||
void set_on_command(std::string command) { this->on_command_ = std::move(command); };
|
||||
void set_off_command(std::string command) { this->off_command_ = std::move(command); };
|
||||
void set_on_command(const std::string &command) { this->on_command_ = command; };
|
||||
void set_off_command(const std::string &command) { this->off_command_ = command; };
|
||||
void dump_config() override;
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user