-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
24 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
const char *html_form = "<html style=\"box-sizing:border-box;font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent\"><head style=\"box-sizing:border-box\"><body style=\'color:#fff;background-color:#1f1f1f;box-sizing:border-box;margin:0;font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";font-size:1rem;font-weight:400;line-height:1.5;text-align:left;min-width:992px!important\'><div style=\"max-width:40em;margin-left:auto;margin-right:auto;padding-top:5em;box-sizing:border-box\"><h1 style=\"box-sizing:border-box;margin-top:0;margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.2;color:inherit;font-size:2.5rem\">CircleHome Settings</h1><form action=\"/submit\"method=\"post\"style=\"box-sizing:border-box\"><div style=\"box-sizing:border-box\"><h2 style=\"box-sizing:border-box;margin-top:0;margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.2;color:inherit;font-size:2rem;orphans:3;widows:3;page-break-after:avoid\">WiFi</h2><div style=\"box-sizing:border-box;margin-bottom:1rem\"class=\"form-group\"><label for=\"wifi_ssid\"style=\"box-sizing:border-box;display:inline-block;margin-bottom:.5rem\">SSID</label> <input class=\"form-control\"id=\"wifi_ssid\"name=\"wifi_ssid\"style=\"box-sizing:border-box;margin:0;font-family:inherit;font-size:1rem;line-height:1.5;overflow:visible;display:block;width:100%;height:calc(2.25rem + 2px);padding:.375rem .75rem;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out\"required></div><div style=\"box-sizing:border-box;margin-bottom:1rem\"class=\"form-group\"><label for=\"wifi_password\"style=\"box-sizing:border-box;display:inline-block;margin-bottom:.5rem\">Password</label> <input class=\"form-control\"id=\"wifi_password\"name=\"wifi_password\"style=\"box-sizing:border-box;margin:0;font-family:inherit;font-size:1rem;line-height:1.5;overflow:visible;display:block;width:100%;height:calc(2.25rem + 2px);padding:.375rem .75rem;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out\"type=\"password\"></div></div><div style=\"box-sizing:border-box\"><h2 style=\"box-sizing:border-box;margin-top:0;margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.2;color:inherit;font-size:2rem;orphans:3;widows:3;page-break-after:avoid\">Home Assistant</h2><div style=\"box-sizing:border-box;margin-bottom:1rem\"class=\"form-group\"><label for=\"ha_hostname\"style=\"box-sizing:border-box;display:inline-block;margin-bottom:.5rem\">Hostname</label> <input class=\"form-control\"id=\"ha_hostname\"name=\"ha_hostname\"style=\"box-sizing:border-box;margin:0;font-family:inherit;font-size:1rem;line-height:1.5;overflow:visible;display:block;width:100%;height:calc(2.25rem + 2px);padding:.375rem .75rem;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out\"placeholder=\"homeassistant.local\"></div><div style=\"box-sizing:border-box;margin-bottom:1rem\"class=\"form-group\"><label for=\"ha_port\"style=\"box-sizing:border-box;display:inline-block;margin-bottom:.5rem\">Port</label> <input class=\"form-control\"id=\"ha_port\"name=\"ha_port\"style=\"box-sizing:border-box;margin:0;font-family:inherit;font-size:1rem;line-height:1.5;overflow:visible;display:block;width:100%;height:calc(2.25rem + 2px);padding:.375rem .75rem;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out\"placeholder=\"8123\"type=\"number\"></div><div style=\"box-sizing:border-box;margin-bottom:1rem\"class=\"form-group\"><label for=\"ha_token\"style=\"box-sizing:border-box;display:inline-block;margin-bottom:.5rem\">Token</label> <input class=\"form-control\"id=\"ha_token\"name=\"ha_token\"style=\"box-sizing:border-box;margin:0;font-family:inherit;font-size:1rem;line-height:1.5;overflow:visible;display:block;width:100%;height:calc(2.25rem + 2px);padding:.375rem .75rem;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out\"type=\"password\"></div></div><div style=\"box-sizing:border-box\"><h2 style=\"box-sizing:border-box;margin-top:0;margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.2;color:inherit;font-size:2rem;orphans:3;widows:3;page-break-after:avoid\">Miscellaneous</h2><div style=\"box-sizing:border-box;margin-bottom:1rem\"class=\"form-group\"><label for=\"ntp_timezone\"style=\"box-sizing:border-box;display:inline-block;margin-bottom:.5rem\">Timezone</label> <input class=\"form-control\"id=\"ntp_timezone\"name=\"ntp_timezone\"style=\"box-sizing:border-box;margin:0;font-family:inherit;font-size:1rem;line-height:1.5;overflow:visible;display:block;width:100%;height:calc(2.25rem + 2px);padding:.375rem .75rem;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out\"placeholder=\"europe/london\"></div></div><div style=\"box-sizing:border-box;margin-bottom:1rem\"class=\"form-group\"><button class=\"btn btn-primary\"name=\"submit\"style=\"box-sizing:border-box;border-radius:.25rem;margin:0;font-family:inherit;font-size:1rem;line-height:1.5;overflow:visible;text-transform:none;-webkit-appearance:button;display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.375rem .75rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;color:#fff;background-color:#007bff;border-color:#007bff\"type=\"submit\">Apply</button></div></form></div>"; | ||
const char *html_form = "<html style=\"box-sizing:border-box;font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent\"><head style=\"box-sizing:border-box\"><body style=\'color:#fff;background-color:#1f1f1f;box-sizing:border-box;margin:0;font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";font-size:1rem;font-weight:400;line-height:1.5;text-align:left;min-width:992px!important\'><div style=\"max-width:40em;margin-left:auto;margin-right:auto;padding-top:5em;box-sizing:border-box\"><h1 style=\"box-sizing:border-box;margin-top:0;margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.2;color:inherit;font-size:2.5rem\">CircleHome Settings</h1><form action=\"/submit\"method=\"post\"style=\"box-sizing:border-box\"><div style=\"box-sizing:border-box\"><h2 style=\"box-sizing:border-box;margin-top:0;margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.2;color:inherit;font-size:2rem;orphans:3;widows:3;page-break-after:avoid\">WiFi</h2><div style=\"box-sizing:border-box;margin-bottom:1rem\"class=\"form-group\"><label for=\"wifi_ssid\"style=\"box-sizing:border-box;display:inline-block;margin-bottom:.5rem\">SSID</label> <input class=\"form-control\"id=\"wifi_ssid\"name=\"wifi_ssid\"style=\"box-sizing:border-box;margin:0;font-family:inherit;font-size:1rem;line-height:1.5;overflow:visible;display:block;width:100%;height:calc(2.25rem + 2px);padding:.375rem .75rem;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out\"></div><div style=\"box-sizing:border-box;margin-bottom:1rem\"class=\"form-group\"><label for=\"wifi_password\"style=\"box-sizing:border-box;display:inline-block;margin-bottom:.5rem\">Password</label> <input class=\"form-control\"id=\"wifi_password\"name=\"wifi_password\"style=\"box-sizing:border-box;margin:0;font-family:inherit;font-size:1rem;line-height:1.5;overflow:visible;display:block;width:100%;height:calc(2.25rem + 2px);padding:.375rem .75rem;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out\"type=\"password\"></div></div><div style=\"box-sizing:border-box\"><h2 style=\"box-sizing:border-box;margin-top:0;margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.2;color:inherit;font-size:2rem;orphans:3;widows:3;page-break-after:avoid\">Home Assistant</h2><div style=\"box-sizing:border-box;margin-bottom:1rem\"class=\"form-group\"><label for=\"ha_hostname\"style=\"box-sizing:border-box;display:inline-block;margin-bottom:.5rem\">Hostname</label> <input class=\"form-control\"id=\"ha_hostname\"name=\"ha_hostname\"style=\"box-sizing:border-box;margin:0;font-family:inherit;font-size:1rem;line-height:1.5;overflow:visible;display:block;width:100%;height:calc(2.25rem + 2px);padding:.375rem .75rem;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out\"placeholder=\"homeassistant.local\"></div><div style=\"box-sizing:border-box;margin-bottom:1rem\"class=\"form-group\"><label for=\"ha_port\"style=\"box-sizing:border-box;display:inline-block;margin-bottom:.5rem\">Port</label> <input class=\"form-control\"id=\"ha_port\"name=\"ha_port\"style=\"box-sizing:border-box;margin:0;font-family:inherit;font-size:1rem;line-height:1.5;overflow:visible;display:block;width:100%;height:calc(2.25rem + 2px);padding:.375rem .75rem;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out\"placeholder=\"8123\"type=\"number\"></div><div style=\"box-sizing:border-box;margin-bottom:1rem\"class=\"form-group\"><label for=\"ha_token\"style=\"box-sizing:border-box;display:inline-block;margin-bottom:.5rem\">Token</label> <input class=\"form-control\"id=\"ha_token\"name=\"ha_token\"style=\"box-sizing:border-box;margin:0;font-family:inherit;font-size:1rem;line-height:1.5;overflow:visible;display:block;width:100%;height:calc(2.25rem + 2px);padding:.375rem .75rem;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out\"type=\"password\"></div></div><div style=\"box-sizing:border-box\"><h2 style=\"box-sizing:border-box;margin-top:0;margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.2;color:inherit;font-size:2rem;orphans:3;widows:3;page-break-after:avoid\">Miscellaneous</h2><div style=\"box-sizing:border-box;margin-bottom:1rem\"class=\"form-group\"><label for=\"ntp_timezone\"style=\"box-sizing:border-box;display:inline-block;margin-bottom:.5rem\">Timezone</label> <input class=\"form-control\"id=\"ntp_timezone\"name=\"ntp_timezone\"style=\"box-sizing:border-box;margin:0;font-family:inherit;font-size:1rem;line-height:1.5;overflow:visible;display:block;width:100%;height:calc(2.25rem + 2px);padding:.375rem .75rem;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out\"placeholder=\"UTC\"></div></div><div style=\"box-sizing:border-box;margin-bottom:1rem\"class=\"form-group\"><button class=\"btn btn-primary\"name=\"submit\"style=\"box-sizing:border-box;border-radius:.25rem;margin:0;font-family:inherit;font-size:1rem;line-height:1.5;overflow:visible;text-transform:none;-webkit-appearance:button;display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.375rem .75rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;color:#fff;background-color:#007bff;border-color:#007bff\"type=\"submit\">Apply</button></div></form></div>"; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
#include <aero_preferences.h> | ||
#include <aero_web_portal.h> | ||
#include "Screen_Settings.h" | ||
void Screen_Settings::resetDevice(lv_event_t *event) | ||
{ | ||
resetPreferences(); | ||
ESP.restart(); | ||
} | ||
void Screen_Settings::configDevice(lv_event_t *event) | ||
{ | ||
aero_web_portal_setup(); | ||
} | ||
void Screen_Settings::create() { | ||
lv_obj_t *button = lv_button_create(_lv_screen); | ||
lv_obj_center(button); | ||
lv_obj_t *text = lv_label_create(button); | ||
lv_label_set_text(text, "Reset Device\nSettings"); | ||
lv_obj_center(text); | ||
lv_obj_add_event_cb(button, resetDevice, LV_EVENT_PRESSED, NULL); | ||
lv_obj_t *reset_button = lv_button_create(_lv_screen); | ||
lv_group_remove_obj(reset_button); | ||
lv_obj_align(reset_button, LV_ALIGN_CENTER, 0, 60); | ||
lv_obj_t *reset_text = lv_label_create(reset_button); | ||
lv_label_set_text(reset_text, "Reset Device\nSettings"); | ||
lv_obj_center(reset_text); | ||
lv_obj_add_event_cb(reset_button, resetDevice, LV_EVENT_PRESSED, NULL); | ||
|
||
lv_obj_t *config_button = lv_button_create(_lv_screen); | ||
lv_group_remove_obj(config_button); | ||
lv_obj_align(config_button, LV_ALIGN_CENTER, 0, -60); | ||
lv_obj_t *config_text = lv_label_create(config_button); | ||
lv_label_set_text(config_text, "Configuration\nMode"); | ||
lv_obj_center(config_text); | ||
lv_obj_add_event_cb(config_button, configDevice, LV_EVENT_PRESSED, NULL); | ||
} | ||
Screen_Settings screen_settings; |
This file contains 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