feat(travel): Refactor route handling to use direction instead of destination
This commit is contained in:
9
main/external/mtr/line_info.cpp
vendored
9
main/external/mtr/line_info.cpp
vendored
@@ -51,3 +51,12 @@ LineInfo::LineInfo(cJSON* line_json) {
|
||||
ESP_LOGW(LINE_INFO_TAG, "Missing or invalid 'stations' array");
|
||||
}
|
||||
}
|
||||
|
||||
const char* LineInfo::get_station_name(const std::string& station_code) const {
|
||||
for (const auto& station : _stations) {
|
||||
if (std::string(station.code()) == station_code) {
|
||||
return station.name();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user