From 79248e8b7477aa577ee64df2fe3878e9efaa582f Mon Sep 17 00:00:00 2001 From: Guillermo Ruffino Date: Sun, 5 Apr 2020 13:42:43 -0300 Subject: [PATCH] fix servo bug restoring state and starting servo detached (#1008) --- esphome/components/servo/servo.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/servo/servo.h b/esphome/components/servo/servo.h index 19165be23d..a37188740c 100644 --- a/esphome/components/servo/servo.h +++ b/esphome/components/servo/servo.h @@ -36,11 +36,11 @@ class Servo : public Component { this->rtc_ = global_preferences.make_preference(global_servo_id); global_servo_id++; if (this->rtc_.load(&v)) { - this->write(v); + this->output_->set_level(v); return; } } - this->write(0.0f); + this->detach(); } void dump_config() override; float get_setup_priority() const override { return setup_priority::DATA; }