Skip to content

Commit 4f6c897

Browse files
committed
fix(77): restore the working exit route, ship ameba v1.3.2
Re-includes swing in the remote-activity exit check on both halves. Removing it was a regression I introduced while fixing the self-cancel. What happened: the entry gesture is "Horizon Airflow x6" -- the swing button -- so swing changes kept arriving for a beat after the window opened and instantly cancelled it (open 95424 ms, killed 95674 ms, every attempt). That got fixed TWO ways at once: exclude swing, and add a 6 s settling grace. The grace alone is sufficient. Excluding swing on top of it removed the exit route that was actually doing the work. Pressing the pattern again is a SWING press, and this A/C appears to emit its 0x20 pulse only on ENTRY -- so the "toggle" path never fires and, with swing excluded, nothing got out of "77" except the 180 s expiry. Confirmed on both nodes by the user. Note the earlier "all the exits work" bench result was therefore measuring the swing path, not the toggle. The toggle stays in (harmless, and correct if a unit does pulse on exit) but must not be relied on. Ameba 1.3.1 -> 1.3.2 (int 10302), flashed to node 14 over Matter OTA and verified; esp32 rebuilt and flashed over USB. Both nodes avail=True, endpoints {0..10}. Known remaining oddity, filed separately rather than patched late: pressing the swing button to exit briefly shows the setpoint and then returns to "77". Most likely our exit fires on the swing change while the A/C emits another 0x20 in the same interaction, so we immediately re-open. Power and setpoint buttons exit cleanly. Assisted-by: AI
1 parent dbc1ddf commit 4f6c897

3 files changed

Lines changed: 21 additions & 14 deletions

File tree

firmware/esp32-matter/main/app_main.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -525,19 +525,22 @@ static void on_status(const HisenseState *st)
525525
* the unit from Matter -- and if something is, the user is plainly not mid-pairing. */
526526
if (recommission_window_is_open() && s_status.valid &&
527527
esp_timer_get_time() > s_recommission_grace_us) {
528-
/* SWING IS EXCLUDED ON PURPOSE. The gesture that ENTERS "77" is "Horizon Airflow x6" --
529-
* i.e. the swing button. Including vswing/hswing here made entering the mode instantly
530-
* exit it: measured window-open at 95424 ms, killed at 95674 ms, every single attempt.
531-
* The entry gesture can never be the exit signal.
528+
/* Swing IS included, and the grace period above is what makes that safe.
532529
*
533-
* The grace period covers the same trap from the other side: the swing changes from the
534-
* final presses keep arriving for a beat after the window opens, and any of the other
535-
* fields could be mid-settle too. */
530+
* History worth keeping: the entry gesture is "Horizon Airflow x6" -- the swing button --
531+
* so swing changes arrive for a beat after the window opens and briefly self-cancelled it
532+
* (open 95424 ms, killed 95674 ms). The first fix excluded swing AND added the grace. The
533+
* grace alone covers the settle; excluding swing on top of it removed the exit route that
534+
* was actually working, because pressing the pattern again is a SWING press and this A/C
535+
* appears to emit its 0x20 pulse only on ENTRY. Result: nothing exited "77" but expiry.
536+
*
537+
* So: keep swing, rely on the grace. Stock exits on any button, and swing is a button. */
536538
const bool user_touched =
537539
st->power_on != s_status.power_on || st->mode != s_status.mode ||
538540
st->setpoint_c != s_status.setpoint_c || st->fan_raw != s_status.fan_raw ||
539541
st->eco_on != s_status.eco_on || st->turbo_on != s_status.turbo_on ||
540-
st->mute_on != s_status.mute_on || st->sleep_raw != s_status.sleep_raw;
542+
st->mute_on != s_status.mute_on || st->sleep_raw != s_status.sleep_raw ||
543+
st->vswing_on != s_status.vswing_on || st->hswing_on != s_status.hswing_on;
541544
if (user_touched) {
542545
ESP_LOGW(TAG, "A/C driven from the remote during the \"77\" window -> treating as EXIT");
543546
chip::DeviceLayer::PlatformMgr().ScheduleWork(recommission_user_cancel, 0);

firmware/src/sdk-edits/matter_drivers.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,16 +191,20 @@ static void hisense_on_status(const HisenseState *state)
191191
/* Stock behaviour: ANY remote button exits "77", not just pressing the pattern again. We
192192
* cannot see IR, but every press lands on the bus as a change to a user-settable field.
193193
*
194-
* SWING IS EXCLUDED ON PURPOSE -- the gesture that ENTERS "77" is "Horizon Airflow x6", i.e.
195-
* the swing button, so including vswing/hswing makes entering the mode instantly exit it
196-
* (measured on the esp32 half: window open at 95424 ms, killed at 95674 ms, every attempt).
197-
* Temperatures / compressor / current are excluded too: they drift every frame. */
194+
* Swing IS included, and the grace period is what makes that safe. The entry gesture is
195+
* "Horizon Airflow x6" -- the swing button -- so its changes arrive for a beat after the
196+
* window opens and briefly self-cancelled it on the esp32 half (open 95424 ms, killed 95674
197+
* ms). Excluding swing on top of the grace removed the exit route that was actually working:
198+
* pressing the pattern again is a SWING press, and this A/C appears to emit its 0x20 pulse
199+
* only on ENTRY, so the toggle never fires and nothing but expiry got out of "77".
200+
* Temperatures / compressor / current stay excluded: they drift every frame. */
198201
if (recommission_window_is_open() && s_status.valid && recommission_grace_expired()) {
199202
const bool user_touched =
200203
state->power_on != s_status.power_on || state->mode != s_status.mode ||
201204
state->setpoint_c != s_status.setpoint_c || state->fan_raw != s_status.fan_raw ||
202205
state->eco_on != s_status.eco_on || state->turbo_on != s_status.turbo_on ||
203-
state->mute_on != s_status.mute_on || state->sleep_raw != s_status.sleep_raw;
206+
state->mute_on != s_status.mute_on || state->sleep_raw != s_status.sleep_raw ||
207+
state->vswing_on != s_status.vswing_on || state->hswing_on != s_status.hswing_on;
204208
if (user_touched) {
205209
ChipLogProgress(DeviceLayer, "A/C driven from the remote during \"77\" -> EXIT");
206210
chip::DeviceLayer::PlatformMgr().ScheduleWork(recommission_user_cancel, 0);

firmware/src/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.1
1+
1.3.2

0 commit comments

Comments
 (0)