diff --git a/MTMR/ItemsParsing.swift b/MTMR/ItemsParsing.swift index a01af0c..9c13304 100644 --- a/MTMR/ItemsParsing.swift +++ b/MTMR/ItemsParsing.swift @@ -83,7 +83,7 @@ class SupportedTypesHolder { return (item: .weather(interval: interval ?? 1800.00, units: units ?? "metric", api_key: api_key ?? "32c4256d09a4c52b38aecddba7a078f6", icon_type: icon_type ?? "text"), action: action, parameters: [:]) }, "currency": { decoder in - enum CodingKeys: String, CodingKey { case refreshInterval; case from; case to } + enum CodingKeys: String, CodingKey { case refreshInterval; case from; case to; case action } let container = try decoder.container(keyedBy: CodingKeys.self) let interval = try container.decodeIfPresent(Double.self, forKey: .refreshInterval) let from = try container.decodeIfPresent(String.self, forKey: .from) diff --git a/MTMR/WeatherBarItem.swift b/MTMR/WeatherBarItem.swift index 9ace384..8951853 100644 --- a/MTMR/WeatherBarItem.swift +++ b/MTMR/WeatherBarItem.swift @@ -81,8 +81,8 @@ class WeatherBarItem: CustomButtonTouchBarItem, CLLocationManagerDelegate { var condition_icon = "" if let main = json["main"] as? [String : AnyObject] { - if let temp = main["temp"] as? Int { - temperature = temp + if let temp = main["temp"] as? Double { + temperature = Int(temp) } } @@ -131,4 +131,3 @@ class WeatherBarItem: CustomButtonTouchBarItem, CLLocationManagerDelegate { } } -