Skip to content

Commit

Permalink
Standardize TTS responses and display status language and font color …
Browse files Browse the repository at this point in the history
…to align with REST and OpenHAB

(cherry picked from commit e24c053)
  • Loading branch information
kristiankielhofner authored and stintel committed Sep 18, 2023
1 parent 4660c0c commit dd99a8b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main/endpoint/hass.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ no_speech:;
if (hir.has_speech) {
hir.ok ? war.fn_ok(hir.speech) : war.fn_err(hir.speech);
} else {
hir.ok ? war.fn_ok("success") : war.fn_err("error");
hir.ok ? war.fn_ok("Success") : war.fn_err("Error");
}

if (lvgl_port_lock(lvgl_lock_timeout)) {
Expand All @@ -156,7 +156,7 @@ no_speech:;
lv_label_set_text(lbl_ln5, hir.speech);
} else {
lv_label_set_text_static(lbl_ln4, "Command status:");
lv_label_set_text(lbl_ln5, hir.ok ? "#008000 Success!" : "#ff0000 Error!");
lv_label_set_text(lbl_ln5, hir.ok ? "Success!" : "Error");
}
lvgl_port_unlock();
}
Expand Down Expand Up @@ -357,10 +357,10 @@ static void hass_post(const char *data)
lv_obj_remove_event_cb(lbl_ln4, cb_btn_cancel);
if (http_status == 200) {
lv_label_set_text_static(lbl_ln4, "Command status:");
lv_label_set_text(lbl_ln5, ok ? "#008000 Success!" : "#ff0000 No Matching HA Intent");
lv_label_set_text(lbl_ln5, ok ? "Success!" : "No Matching HA Intent");
} else {
lv_label_set_text_static(lbl_ln4, "Error contacting HASS:");
lv_label_set_text_fmt(lbl_ln5, "#ff0000 HTTP %d", http_status);
lv_label_set_text_fmt(lbl_ln5, "HTTP %d", http_status);
}

lvgl_port_unlock();
Expand Down

0 comments on commit dd99a8b

Please sign in to comment.