2fb: use constants for API keys

This commit is contained in:
Xiretza 2022-08-16 20:10:10 +02:00
parent 89ff9de41d
commit 0c468f3e4f
2 changed files with 4 additions and 6 deletions

View file

@ -1,6 +1,4 @@
// rename this file to "APIKey.h" and fill in a real key!
String thingtweetAPIKey = "myThingspeakKey";
String serverAPIKey = "myserverAPIKey";
String pingGetAPIKey ="pingGetApiKey";
#define UPDATE_API_KEY "updateApiKey"
#define PING_GET_API_KEY "pingGetApiKey"

View file

@ -339,7 +339,7 @@ void TriggerServerUpdate(boolean stat) {
if(debug){Serial.println("making HTTP request...");}
// make HTTP GET request to server:
String s =(stat?"true":"false");
client.println("GET /api/update.php?open=" + s + "&apikey="+serverAPIKey+" HTTP/1.1");
client.println("GET /api/update.php?open=" + s + "&apikey=" UPDATE_API_KEY + " HTTP/1.1");
client.println("HOST: " SERVER_DOMAIN);
client.println("Connection: close");
client.println();
@ -364,7 +364,7 @@ void readButtons(){
}
void RequestPing() {
TriggerServerReq("/api/ping-get.php?apikey="+pingGetAPIKey,1);
TriggerServerReq("/api/ping-get.php?apikey=" PING_GET_API_KEY,1);
}
void launchUpdate(){