From 386d6b8ce22a0fe0c2ef8891402e7f14cd3ddd8d Mon Sep 17 00:00:00 2001 From: "Deomid \"rojer\" Ryabkov" Date: Sun, 5 Sep 2021 12:34:44 +0100 Subject: [PATCH] WC: Reset calibration flag when swapping outputs https://github.com/mongoose-os-apps/shelly-homekit/issues/780#issuecomment-913042594 --- src/shelly_hap_window_covering.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shelly_hap_window_covering.cpp b/src/shelly_hap_window_covering.cpp index 34fe703e..096c5983 100644 --- a/src/shelly_hap_window_covering.cpp +++ b/src/shelly_hap_window_covering.cpp @@ -237,6 +237,9 @@ Status WindowCovering::SetConfig(const std::string &config_json, } if (swap_outputs != -1 && swap_outputs != cfg_->swap_outputs) { cfg_->swap_outputs = swap_outputs; + // As movement direction is now reversed, position is now incorrect too. + // Let's re-calibrate. + cfg_->calibrated = false; *restart_required = true; } return Status::OK();