values: Include firmware build date
Home Assistant will display a "Firmware Version" field in the device information panel if the `sw_version` field is populated in the discovery configuration payload. We'll fill this with the build date and time of the firmware as a proxy.
This commit is contained in:
@@ -10,4 +10,6 @@
|
|||||||
#define TOPIC_STATE "garden/state"
|
#define TOPIC_STATE "garden/state"
|
||||||
|
|
||||||
#define SLEEP_MILLIS_EARLY (1000 * 60)
|
#define SLEEP_MILLIS_EARLY (1000 * 60)
|
||||||
#define SLEEP_MILLIS (1000 * 60 * 60)
|
#define SLEEP_MILLIS (1000 * 60 * 60)
|
||||||
|
|
||||||
|
#define VERSION __DATE__ " " __TIME__
|
||||||
@@ -38,6 +38,7 @@ static bool publish_config(PubSubClient* mqtt, const char* topic,
|
|||||||
device["manufacturer"] = DEVICE_MANUFACTURER;
|
device["manufacturer"] = DEVICE_MANUFACTURER;
|
||||||
device["name"] = DEVICE_NAME;
|
device["name"] = DEVICE_NAME;
|
||||||
device["model"] = DEVICE_MODEL;
|
device["model"] = DEVICE_MODEL;
|
||||||
|
device["sw_version"] = VERSION;
|
||||||
auto ident = device.createNestedArray("identifiers");
|
auto ident = device.createNestedArray("identifiers");
|
||||||
ident.add(config->identifier);
|
ident.add(config->identifier);
|
||||||
String msg;
|
String msg;
|
||||||
|
|||||||
Reference in New Issue
Block a user