Skip to content

Commit

Permalink
Merge pull request #21 from Floyddotnet/pull-status-window-mode
Browse files Browse the repository at this point in the history
Add window-mode property to status notification
  • Loading branch information
softypit authored Mar 29, 2019
2 parents 87e8679 + 7e5bc00 commit a0f29b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +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"`<br>`"boost"`:`"inactive"` | 1.20 |
| state | front-panel controls are locked / unlocked | `"state"`:`"locked"`<br>`"state"`:`"unlocked"` | 1.20 |
| battery | battery state | `"battery"`:`"GOOD"`<br>`"battery"`:`"LOW"` | 1.20 |
<sup>1)</sup> Changed in current dev-branch: `"eco"` is removed because it was misinterpreted
| window | window-mode is active / inactive | `"window"`:`"open"`<br>`"window"`:`"closed"` | |

### Read current status

Expand Down
5 changes: 5 additions & 0 deletions main/eq3_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,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){
Expand Down

0 comments on commit a0f29b4

Please sign in to comment.