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! // rename this file to "APIKey.h" and fill in a real key!
String thingtweetAPIKey = "myThingspeakKey"; #define UPDATE_API_KEY "updateApiKey"
String serverAPIKey = "myserverAPIKey"; #define PING_GET_API_KEY "pingGetApiKey"
String pingGetAPIKey ="pingGetApiKey";

View file

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