Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

give all pubs a common root; closes #30 #34

Merged
merged 1 commit into from
Mar 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions brew-buddy-firmware/src/brew-buddy-firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ QueueArray<long> knockArray;
float fermentationRate = 0; // knocks per ms
unsigned long lastKnock;

String messageBase = "bb/";

String brewStage;
String brewId;

Expand Down Expand Up @@ -153,7 +155,7 @@ void loop()
displayFermentationModeDelta();

waitUntil(Particle.connected);
Particle.publish("fermentation/state", "start");
Particle.publish(messageBase + "ferment/state", "start");
}
else
{
Expand Down Expand Up @@ -373,13 +375,13 @@ float readTemp()
void postTemp(float temp)
{
String payload = "{ \"temperature\":" + String(temp, 2) + ", \"time\": \"" + millis() + "\" }";
Particle.publish("brewing/temp", payload);
Particle.publish(messageBase + "brew/temp", payload);
}

void postFermentationRate()
{
String payload = "{ \"current_rate\":" + String(fermentationRate, 2) + ", \"time\": \"" + millis() + "\" }";
Particle.publish("fermentation/rate", payload);
Particle.publish(messageBase + "ferment/rate", payload);
}

void printReading(float reading)
Expand Down