1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 03:12:20 +01:00

fix servo bug restoring state and starting servo detached (#1008)

This commit is contained in:
Guillermo Ruffino
2020-04-05 13:42:43 -03:00
committed by GitHub
parent 4620ad6124
commit 79248e8b74

View File

@@ -36,11 +36,11 @@ class Servo : public Component {
this->rtc_ = global_preferences.make_preference<float>(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; }