only publish height if it has changed
This commit is contained in:
@@ -55,9 +55,11 @@ void Desky::loop() {
|
||||
break;
|
||||
case 3:
|
||||
value = (high_byte << 8) + c;
|
||||
this->current_pos_ = value;
|
||||
if (this->height_sensor_ != nullptr)
|
||||
this->height_sensor_->publish_state(value);
|
||||
if (this->current_pos_ != value) {
|
||||
this->current_pos_ = value;
|
||||
if (this->height_sensor_ != nullptr)
|
||||
this->height_sensor_->publish_state(value);
|
||||
}
|
||||
state = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user