Skip to content

Commit 8b909c7

Browse files
author
Brandon Satrom
authored
Merge pull request #34 from bsatrom/feature/cloud-publishing
give all pubs a common root; closes #30
2 parents ff7a7eb + 1746b62 commit 8b909c7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

brew-buddy-firmware/src/brew-buddy-firmware.ino

+5-3
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ QueueArray<long> knockArray;
8787
float fermentationRate = 0; // knocks per ms
8888
unsigned long lastKnock;
8989

90+
String messageBase = "bb/";
91+
9092
String brewStage;
9193
String brewId;
9294

@@ -153,7 +155,7 @@ void loop()
153155
displayFermentationModeDelta();
154156

155157
waitUntil(Particle.connected);
156-
Particle.publish("fermentation/state", "start");
158+
Particle.publish(messageBase + "ferment/state", "start");
157159
}
158160
else
159161
{
@@ -373,13 +375,13 @@ float readTemp()
373375
void postTemp(float temp)
374376
{
375377
String payload = "{ \"temperature\":" + String(temp, 2) + ", \"time\": \"" + millis() + "\" }";
376-
Particle.publish("brewing/temp", payload);
378+
Particle.publish(messageBase + "brew/temp", payload);
377379
}
378380

379381
void postFermentationRate()
380382
{
381383
String payload = "{ \"current_rate\":" + String(fermentationRate, 2) + ", \"time\": \"" + millis() + "\" }";
382-
Particle.publish("fermentation/rate", payload);
384+
Particle.publish(messageBase + "ferment/rate", payload);
383385
}
384386

385387
void printReading(float reading)

0 commit comments

Comments
 (0)