This repository was archived by the owner on May 24, 2022. It is now read-only.
File tree 2 files changed +4
-3
lines changed 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
// OpenWeather details
2
2
#define OPEN_WEATHER_DISPLAYED_CITY_NAME "Vancouver"
3
3
#define OPEN_WEATHER_LANGUAGE "en"
4
- #define OPEN_WEATHER_MAP_APP_ID ""
5
4
#define OPEN_WEATHER_MAP_LOCATION_ID "6173331"
6
5
7
6
// Define data display formats
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ time_t dstOffset = 0;
9
9
uint8_t moonAge = 0 ;
10
10
String moonAgeImage = " " ;
11
11
12
+ HomieSetting<const char *> owApiKey (" ow_api_key" , " Open Weather API Key" );
13
+
12
14
void setup () {
13
15
Serial.begin (115200 );
14
16
@@ -313,14 +315,14 @@ void updateData() {
313
315
currentWeatherClient.setMetric (IS_METRIC);
314
316
currentWeatherClient.setLanguage (OPEN_WEATHER_LANGUAGE);
315
317
currentWeatherClient.updateCurrentById (
316
- ¤tWeather, OPEN_WEATHER_MAP_APP_ID , OPEN_WEATHER_MAP_LOCATION_ID);
318
+ ¤tWeather, owApiKey. get () , OPEN_WEATHER_MAP_LOCATION_ID);
317
319
318
320
drawProgress (70 , F (" Updating forecasts..." ));
319
321
forecastClient.setMetric (IS_METRIC);
320
322
forecastClient.setLanguage (OPEN_WEATHER_LANGUAGE);
321
323
uint8_t allowedHours[] = {12 , 0 };
322
324
forecastClient.setAllowedHours (allowedHours, sizeof (allowedHours));
323
- forecastClient.updateForecastsById (forecasts, OPEN_WEATHER_MAP_APP_ID ,
325
+ forecastClient.updateForecastsById (forecasts, owApiKey. get () ,
324
326
OPEN_WEATHER_MAP_LOCATION_ID,
325
327
MAX_FORECASTS);
326
328
You can’t perform that action at this time.
0 commit comments