Load Finnhub key from gitignored secrets.h; ignore local credentials
This commit is contained in:
parent
2029b45303
commit
0777f8b751
2 changed files with 18 additions and 1 deletions
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
.pio/
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
# Local credentials - never commit
|
||||||
|
include/secrets.h
|
||||||
|
secrets.h
|
||||||
13
src/main.cpp
13
src/main.cpp
|
|
@ -15,6 +15,10 @@
|
||||||
#include <Preferences.h>
|
#include <Preferences.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
#if __has_include("secrets.h")
|
||||||
|
#include "secrets.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SCREEN_WIDTH 800
|
#define SCREEN_WIDTH 800
|
||||||
#define SCREEN_HEIGHT 480
|
#define SCREEN_HEIGHT 480
|
||||||
|
|
||||||
|
|
@ -31,7 +35,7 @@
|
||||||
#define MAX_INDICES 5
|
#define MAX_INDICES 5
|
||||||
#define MAX_TICKER_LEN 8
|
#define MAX_TICKER_LEN 8
|
||||||
|
|
||||||
#define FINNHUB_API_KEY "***REDACTED***"
|
#define FINNHUB_API_KEY ""
|
||||||
|
|
||||||
class LGFX : public lgfx::LGFX_Device {
|
class LGFX : public lgfx::LGFX_Device {
|
||||||
public:
|
public:
|
||||||
|
|
@ -2218,5 +2222,12 @@ if (currentScreen == SCREEN_HARD_MONEY_DETAIL && millis() - lastCountdownUpdate
|
||||||
drawDashboard();
|
drawDashboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (currentScreen == SCREEN_HARD_MONEY_DETAIL && millis() - lastRefresh > REFRESH_INTERVAL) {
|
||||||
|
updatePrices();
|
||||||
|
lastRefresh = millis();
|
||||||
|
fetchAllHmData(hmSparklinePeriod);
|
||||||
|
drawHardMoneyDetailScreen();
|
||||||
|
}
|
||||||
|
|
||||||
delay(100);
|
delay(100);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue