mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-05 12:30:28 +02:00
fix servo not reattaching with same target (#1649)
This commit is contained in:
committed by
Jesse Hills
parent
566c129435
commit
392ed64375
@@ -52,6 +52,8 @@ void Servo::loop() {
|
|||||||
|
|
||||||
void Servo::write(float value) {
|
void Servo::write(float value) {
|
||||||
value = clamp(value, -1.0f, 1.0f);
|
value = clamp(value, -1.0f, 1.0f);
|
||||||
|
if (this->target_value_ == value)
|
||||||
|
this->internal_write(value);
|
||||||
this->target_value_ = value;
|
this->target_value_ = value;
|
||||||
this->source_value_ = this->current_value_;
|
this->source_value_ = this->current_value_;
|
||||||
this->state_ = STATE_ATTACHED;
|
this->state_ = STATE_ATTACHED;
|
||||||
|
|||||||
Reference in New Issue
Block a user