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.master
parent
c9cacc540f
commit
d0e546571e
|
@ -11,3 +11,5 @@
|
||||||
|
|
||||||
#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;
|
||||||
|
|
Loading…
Reference in New Issue