@@ -153,22 +153,22 @@ void Weather::Refresh() {
153153 if (optCurrentForecast) {
154154 std::tm localTime = *std::localtime (reinterpret_cast <const time_t *>(&optCurrentForecast->timestamp ));
155155
156- for (int i = 0 ; i < Controllers::SimpleWeatherService::MaxNbForecastDays ; i++) {
157- int16_t minTemp = optCurrentForecast->days [i]. maxTemperature .Celsius ();
158- int16_t maxTemp = optCurrentForecast->days [i]. minTemperature .Celsius ();
156+ for (int i = 0 ; i < optCurrentForecast-> nbDays ; i++) {
157+ int16_t minTemp = optCurrentForecast->days [i]-> maxTemperature .Celsius ();
158+ int16_t maxTemp = optCurrentForecast->days [i]-> minTemperature .Celsius ();
159159 if (settingsController.GetWeatherFormat () == Controllers::Settings::WeatherFormat::Imperial) {
160- minTemp = optCurrentForecast->days [i]. maxTemperature .Fahrenheit ();
161- maxTemp = optCurrentForecast->days [i]. minTemperature .Fahrenheit ();
160+ minTemp = optCurrentForecast->days [i]-> maxTemperature .Fahrenheit ();
161+ maxTemp = optCurrentForecast->days [i]-> minTemperature .Fahrenheit ();
162162 }
163- lv_table_set_cell_type (forecast, 2 , i, TemperatureStyle (optCurrentForecast->days [i]. maxTemperature ));
164- lv_table_set_cell_type (forecast, 3 , i, TemperatureStyle (optCurrentForecast->days [i]. minTemperature ));
163+ lv_table_set_cell_type (forecast, 2 , i, TemperatureStyle (optCurrentForecast->days [i]-> maxTemperature ));
164+ lv_table_set_cell_type (forecast, 3 , i, TemperatureStyle (optCurrentForecast->days [i]-> minTemperature ));
165165 uint8_t wday = localTime.tm_wday + i + 1 ;
166166 if (wday > 7 ) {
167167 wday -= 7 ;
168168 }
169169 const char * dayOfWeek = Controllers::DateTime::DayOfWeekShortToStringLow (static_cast <Controllers::DateTime::Days>(wday));
170170 lv_table_set_cell_value (forecast, 0 , i, dayOfWeek);
171- lv_table_set_cell_value (forecast, 1 , i, Symbols::GetSymbol (optCurrentForecast->days [i]. iconId ));
171+ lv_table_set_cell_value (forecast, 1 , i, Symbols::GetSymbol (optCurrentForecast->days [i]-> iconId ));
172172 // Pad cells based on the largest number of digits on each column
173173 char maxPadding[3 ] = " " ;
174174 char minPadding[3 ] = " " ;
0 commit comments