Conversation
`AirConditioner::control()` silently discarded any call made while `m_sendControl` was true, with no log line, queue, or merge. In practice this drops every attribute but the first when several are set in quick succession (e.g. a Home Assistant scene setting mode, target temperature, preset, swing, and fan on a `midea` climate entity within milliseconds). Accumulate such calls into a pending `Control` instead, merging per field so the latest value for each field wins. Replay the accumulated pending control once the in-flight request completes (either success or failure). By then `m_readStatus()` has already refreshed the local state from the appliance's response, so mode-gated fields (fan/swing under `MODE_OFF`) evaluate against current rather than stale state. Verified it compiles against esp8266-arduino, esp32-arduino, and esp32-idf, and OTA-flashed to real hardware (SLWF-01Pro dongle) driving an Electra/Midea AC unit: a scene setting mode/temp/preset/swing/fan now converges in one application instead of several. Fixes dudanov#47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AirConditioner::control()silently discarded any call made whilem_sendControlwas true, with no log line, queue, or merge. In practice this drops every attribute but the first when several are set in quick succession (e.g. a Home Assistant scene setting mode, target temperature, preset, swing, and fan on amideaclimate entity within milliseconds).Accumulate such calls into a pending
Controlinstead, merging per field so the latest value for each field wins. Replay the accumulated pending control once the in-flight request completes (either success or failure). By thenm_readStatus()has already refreshed the local state from the appliance's response, so mode-gated fields (fan/swing underMODE_OFF) evaluate against current rather than stale state.Verified it compiles against esp8266-arduino, esp32-arduino, and esp32-idf, and OTA-flashed to real hardware (SLWF-01Pro dongle) driving an Electra/Midea AC unit: a scene setting mode/temp/preset/swing/fan now converges in one application instead of several.
Fixes #47