diff --git a/constants.h b/constants.h index ee9ecd8..a700516 100644 --- a/constants.h +++ b/constants.h @@ -10,4 +10,6 @@ #define TOPIC_STATE "garden/state" #define SLEEP_MILLIS_EARLY (1000 * 60) -#define SLEEP_MILLIS (1000 * 60 * 60) \ No newline at end of file +#define SLEEP_MILLIS (1000 * 60 * 60) + +#define VERSION __DATE__ " " __TIME__ \ No newline at end of file diff --git a/mqtt_discovery.cpp b/mqtt_discovery.cpp index e962913..dcf5134 100644 --- a/mqtt_discovery.cpp +++ b/mqtt_discovery.cpp @@ -38,6 +38,7 @@ static bool publish_config(PubSubClient* mqtt, const char* topic, device["manufacturer"] = DEVICE_MANUFACTURER; device["name"] = DEVICE_NAME; device["model"] = DEVICE_MODEL; + device["sw_version"] = VERSION; auto ident = device.createNestedArray("identifiers"); ident.add(config->identifier); String msg;