feat(travel): Implement settings UI and web server for MTR route configuration
- Added MainUIHandler class to manage the main UI and polling for arrival data. - Introduced SettingsUI class for displaying QR code and configuration options. - Created SettingsUIHandler to manage settings UI lifecycle and web server interactions. - Developed WebHandler to handle HTTP requests for MTR route settings, including adding and removing routes. - Implemented web endpoints for fetching MTR lines, routes, and saving settings. - Enhanced UI with responsive design for e-ink displays and added error handling for web interactions.
This commit is contained in:
8
main/external/mtr/line_info.cpp
vendored
8
main/external/mtr/line_info.cpp
vendored
@@ -17,6 +17,14 @@ LineInfo::LineInfo(cJSON* line_json) {
|
||||
ESP_LOGW(LINE_INFO_TAG, "Missing or invalid 'code' field");
|
||||
}
|
||||
|
||||
// Parse line name
|
||||
cJSON* name_json = cJSON_GetObjectItem(line_json, "name");
|
||||
if (name_json && cJSON_IsString(name_json)) {
|
||||
_name = name_json->valuestring;
|
||||
} else {
|
||||
ESP_LOGW(LINE_INFO_TAG, "Missing or invalid 'name' field");
|
||||
}
|
||||
|
||||
// Parse line color (note: field is 'line_color' in JSON, not 'color')
|
||||
cJSON* color_json = cJSON_GetObjectItem(line_json, "line_color");
|
||||
if (color_json && cJSON_IsString(color_json)) {
|
||||
|
||||
Reference in New Issue
Block a user