mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Zepp OS: Allow missing lon/lat in weather v5
This commit is contained in:
+2
-5
@@ -36,17 +36,14 @@ object ZeppOsWeatherHandlerV5 {
|
||||
}
|
||||
|
||||
// /weather/v5/<LOCALE>/<LONGITUDE>/<LATITUDE>/
|
||||
if (!Regex("^/weather/v5/[^/]+/[^/]+/[^/]+/?$").matches(path)) {
|
||||
if (!Regex("^/weather/v5/[^/]+/[^/]*/[^/]*/?$").matches(path)) {
|
||||
LOG.error("Unknown path: {}", path)
|
||||
return null
|
||||
}
|
||||
|
||||
val pathParts = path.trim('/').split("/")
|
||||
val locale = pathParts[2]
|
||||
val longitude = pathParts[3]
|
||||
val latitude = pathParts[4]
|
||||
|
||||
LOG.debug("Weather request: locale={}, lon={}, lat={}", locale, longitude, latitude)
|
||||
LOG.debug("Weather request: {}", pathParts)
|
||||
|
||||
val datasetsParam = query["datasets"]
|
||||
if (datasetsParam.isNullOrBlank()) {
|
||||
|
||||
Reference in New Issue
Block a user