Skip to content

Commit

Permalink
fix bug in HTTP pushes
Browse files Browse the repository at this point in the history
  • Loading branch information
sidoh committed Dec 27, 2017
1 parent 0b207b4 commit 196c209
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ time_t timestamp() {

void updateTemperature(uint8_t* deviceId, float temp) {
String deviceName = settings.deviceName(deviceId);
String strDeviceId = settings.deviceName(deviceId, false);

StaticJsonBuffer<100> responseBuffer;
JsonObject& response = responseBuffer.createObject();
Expand All @@ -49,10 +50,10 @@ void updateTemperature(uint8_t* deviceId, float temp) {

response.printTo(body);

if (settings.sensorPaths.count(deviceName) > 0) {
if (settings.sensorPaths.count(strDeviceId) > 0) {
HTTPClient http;

String sensorPath = settings.sensorPaths[deviceName];
String sensorPath = settings.sensorPaths[strDeviceId];
time_t now = timestamp();
String url = String(settings.gatewayServer) + sensorPath;

Expand Down

0 comments on commit 196c209

Please sign in to comment.