-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for MQTT birth message (#422)
- Loading branch information
Showing
10 changed files
with
73 additions
and
13 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include <AboutStringHelper.h> | ||
#include <ArduinoJson.h> | ||
#include <Settings.h> | ||
#include <ESP8266WiFi.h> | ||
|
||
String AboutStringHelper::generateAboutString(bool abbreviated) { | ||
DynamicJsonBuffer buffer; | ||
JsonObject& response = buffer.createObject(); | ||
|
||
response["firmware"] = QUOTE(FIRMWARE_NAME); | ||
response["version"] = QUOTE(MILIGHT_HUB_VERSION); | ||
response["ip_address"] = WiFi.localIP().toString(); | ||
response["reset_reason"] = ESP.getResetReason(); | ||
|
||
if (! abbreviated) { | ||
response["variant"] = QUOTE(FIRMWARE_VARIANT); | ||
response["free_heap"] = ESP.getFreeHeap(); | ||
response["arduino_version"] = ESP.getCoreVersion(); | ||
} | ||
|
||
String body; | ||
response.printTo(body); | ||
|
||
return body; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include <Arduino.h> | ||
|
||
#ifndef _ABOUT_STRING_HELPER_H | ||
#define _ABOUT_STRING_HELPER_H | ||
|
||
class AboutStringHelper { | ||
public: | ||
static String generateAboutString(bool abbreviated = false); | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters