From 34aee6b010189c29e2cb7bf3b65490f5e7c57cf7 Mon Sep 17 00:00:00 2001 From: Peter Becker Date: Sat, 2 Mar 2019 22:29:45 +0100 Subject: [PATCH] add window-mode property to status notification sometimes it is usefull to know if the window-mode is active or not. this patch introduce a new json property "window" with will indicate this --- README.md | 1 + main/eq3_main.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index a8425e5..4594c12 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ This can be used as an acknowledgement of a successful command to remote mqtt cl | boost | boost-mode is active / inactiv | `"boost"`:`"active"`
`"boost"`:`"inactive"` | 1.20 | | state | front-panel controls are locked / unlocked | `"state"`:`"locked"`
`"state"`:`"unlocked"` | 1.20 | | battery | battery state | `"battery"`:`"GOOD"`
`"battery"`:`"LOW"` | 1.20 | +| window | window-mode is active / inactive | `"window"`:`"open"`
`"window"`:`"closed"` | | ### Read current status diff --git a/main/eq3_main.c b/main/eq3_main.c index 3110ec3..4530dc0 100644 --- a/main/eq3_main.c +++ b/main/eq3_main.c @@ -540,8 +540,13 @@ static void gattc_profile_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_ ESP_LOGI(GATTC_TAG, "eq3 no boost"); statidx += sprintf(&statrep[statidx], "\"inactive\""); } + statidx += sprintf(&statrep[statidx], ",\"window\":"); if(tempval & WINDOW){ ESP_LOGI(GATTC_TAG, "eq3 window open"); + statidx += sprintf(&statrep[statidx], "\"open\""); + }else{ + ESP_LOGI(GATTC_TAG, "eq3 window closed"); + statidx += sprintf(&statrep[statidx], "\"closed\""); } statidx += sprintf(&statrep[statidx], ",\"state\":"); if(tempval & LOCKED){