mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 14:37:04 +00:00
[ezo] Use make_unique to construct EzoCommand (#16092)
This commit is contained in:
@@ -35,7 +35,7 @@ void EZOSensor::update() {
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
std::unique_ptr<EzoCommand> ezo_command(new EzoCommand);
|
||||
auto ezo_command = make_unique<EzoCommand>();
|
||||
ezo_command->command = "R";
|
||||
ezo_command->command_type = EzoCommandType::EZO_READ;
|
||||
ezo_command->delay_ms = 900;
|
||||
@@ -162,7 +162,7 @@ void EZOSensor::loop() {
|
||||
}
|
||||
|
||||
void EZOSensor::add_command_(const char *command, EzoCommandType command_type, uint16_t delay_ms) {
|
||||
std::unique_ptr<EzoCommand> ezo_command(new EzoCommand);
|
||||
auto ezo_command = make_unique<EzoCommand>();
|
||||
ezo_command->command = command;
|
||||
ezo_command->command_type = command_type;
|
||||
ezo_command->delay_ms = delay_ms;
|
||||
|
||||
Reference in New Issue
Block a user