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
Dustin 2022-05-16 21:32:00 -05:00
parent c9cacc540f
commit d0e546571e
2 changed files with 4 additions and 1 deletions

View File

@ -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__

View File

@ -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;