@@ -934,9 +934,7 @@ void loop() {
934934 mqttClient.publish (availability_topic, " online" , true );
935935
936936 JsonDocument mqttDoc;
937- char installedVersion[32 ];
938- snprintf (installedVersion, sizeof (installedVersion), " %s (%s)" , VERSION , COMMIT_HASH );
939- mqttDoc[" installed_version" ] = installedVersion;
937+ mqttDoc[" installed_version" ] = VERSION ;
940938 mqttDoc[" latest_version" ] = VERSION ;
941939 char topic[MQTT_TOPIC_UPDATE_STATE_PATTERN_LENGTH +1 ];
942940 snprintf (topic, sizeof (topic), MQTT_TOPIC_UPDATE_STATE_PATTERN , deviceIdentity.data .uuid );
@@ -3621,9 +3619,7 @@ void setup_OtaFirmware(){
36213619 eventLog.createEvent (" OTA update available" );
36223620
36233621 JsonDocument mqttDoc;
3624- char installedVersion[32 ];
3625- snprintf (installedVersion, sizeof (installedVersion), " %s (%s)" , VERSION , COMMIT_HASH );
3626- mqttDoc[" installed_version" ] = installedVersion;
3622+ mqttDoc[" installed_version" ] = VERSION ;
36273623 mqttDoc[" latest_version" ] = version;
36283624 if (releaseUrl && strlen (releaseUrl) > 0 ){
36293625 mqttDoc[" release_url" ] = releaseUrl;
@@ -3726,9 +3722,7 @@ void otaFirmware_checkPending(){
37263722 eventLog.createEvent (" OTA update available" );
37273723 if (deviceIdentity.enabled && mqttClient.connected ()){
37283724 JsonDocument mqttDoc;
3729- char installedVersion[32 ];
3730- snprintf (installedVersion, sizeof (installedVersion), " %s (%s)" , VERSION , COMMIT_HASH );
3731- mqttDoc[" installed_version" ] = installedVersion;
3725+ mqttDoc[" installed_version" ] = VERSION ;
37323726 const char * targetVersion = _otaPendingDoc[" version" ] | VERSION ;
37333727 mqttDoc[" latest_version" ] = targetVersion;
37343728 const char * releaseUrl = _otaPendingDoc[" release_url" ] | " " ;
@@ -4388,7 +4382,7 @@ void mqtt_autoDiscovery_temperature(){
43884382 device[" model" ] = APPLICATION_NAME ;
43894383 device[" model_id" ] = deviceIdentity.data .product_id ;
43904384 device[" serial_number" ] = deviceIdentity.data .uuid ;
4391- device[" sw_version" ] = VERSION ;
4385+ device[" sw_version" ] = VERSION " ( " COMMIT_HASH " ) " ;
43924386 device[" configuration_url" ] = (" http://" + ETH .localIP ().toString ()).c_str ();
43934387
43944388 if (strlen (mqttClient.autoDiscovery .suggestedArea ) > 0 ){
@@ -4960,7 +4954,7 @@ void mqtt_autoDiscovery_inputControllers(){
49604954 device[" model" ] = APPLICATION_NAME ;
49614955 device[" model_id" ] = deviceIdentity.data .product_id ;
49624956 device[" serial_number" ] = deviceIdentity.data .uuid ;
4963- device[" sw_version" ] = VERSION ;
4957+ device[" sw_version" ] = VERSION " ( " COMMIT_HASH " ) " ;
49644958 device[" configuration_url" ] = (" http://" + ETH .localIP ().toString ()).c_str ();
49654959
49664960 if (strlen (mqttClient.autoDiscovery .suggestedArea ) > 0 ){
@@ -5034,7 +5028,7 @@ void mqtt_autoDiscovery_outputControllers(){
50345028 device[" model" ] = APPLICATION_NAME ;
50355029 device[" model_id" ] = deviceIdentity.data .product_id ;
50365030 device[" serial_number" ] = deviceIdentity.data .uuid ;
5037- device[" sw_version" ] = VERSION ;
5031+ device[" sw_version" ] = VERSION " ( " COMMIT_HASH " ) " ;
50385032 device[" configuration_url" ] = (" http://" + ETH .localIP ().toString ()).c_str ();
50395033
50405034 if (strlen (mqttClient.autoDiscovery .suggestedArea ) > 0 ){
@@ -5093,7 +5087,7 @@ void mqtt_autoDiscovery_start_time(){
50935087 device[" model" ] = APPLICATION_NAME ;
50945088 device[" model_id" ] = deviceIdentity.data .product_id ;
50955089 device[" serial_number" ] = deviceIdentity.data .uuid ;
5096- device[" sw_version" ] = VERSION ;
5090+ device[" sw_version" ] = VERSION " ( " COMMIT_HASH " ) " ;
50975091 device[" configuration_url" ] = (" http://" + ETH .localIP ().toString ()).c_str ();
50985092
50995093 if (strlen (mqttClient.autoDiscovery .suggestedArea ) > 0 ){
@@ -5177,7 +5171,7 @@ void mqtt_autoDiscovery_mac_address(){
51775171 device[" model" ] = APPLICATION_NAME ;
51785172 device[" model_id" ] = deviceIdentity.data .product_id ;
51795173 device[" serial_number" ] = deviceIdentity.data .uuid ;
5180- device[" sw_version" ] = VERSION ;
5174+ device[" sw_version" ] = VERSION " ( " COMMIT_HASH " ) " ;
51815175 device[" configuration_url" ] = (" http://" + ETH .localIP ().toString ()).c_str ();
51825176
51835177 if (strlen (mqttClient.autoDiscovery .suggestedArea ) > 0 ){
@@ -5257,7 +5251,7 @@ void mqtt_autoDiscovery_ip_address(){
52575251 device[" model" ] = APPLICATION_NAME ;
52585252 device[" model_id" ] = deviceIdentity.data .product_id ;
52595253 device[" serial_number" ] = deviceIdentity.data .uuid ;
5260- device[" sw_version" ] = VERSION ;
5254+ device[" sw_version" ] = VERSION " ( " COMMIT_HASH " ) " ;
52615255 device[" configuration_url" ] = (" http://" + ETH .localIP ().toString ()).c_str ();
52625256
52635257 if (strlen (mqttClient.autoDiscovery .suggestedArea ) > 0 ){
@@ -5340,7 +5334,7 @@ void mqtt_autoDiscovery_count_errors(){
53405334 device[" model" ] = APPLICATION_NAME ;
53415335 device[" model_id" ] = deviceIdentity.data .product_id ;
53425336 device[" serial_number" ] = deviceIdentity.data .uuid ;
5343- device[" sw_version" ] = VERSION ;
5337+ device[" sw_version" ] = VERSION " ( " COMMIT_HASH " ) " ;
53445338 device[" configuration_url" ] = (" http://" + ETH .localIP ().toString ()).c_str ();
53455339
53465340 if (strlen (mqttClient.autoDiscovery .suggestedArea ) > 0 ){
@@ -5427,7 +5421,7 @@ void mqtt_autoDiscovery_update(){
54275421 device[" model" ] = APPLICATION_NAME ;
54285422 device[" model_id" ] = deviceIdentity.data .product_id ;
54295423 device[" serial_number" ] = deviceIdentity.data .uuid ;
5430- device[" sw_version" ] = VERSION ;
5424+ device[" sw_version" ] = VERSION " ( " COMMIT_HASH " ) " ;
54315425 device[" configuration_url" ] = (" http://" + ETH .localIP ().toString ()).c_str ();
54325426
54335427 if (strlen (mqttClient.autoDiscovery .suggestedArea ) > 0 ){
@@ -5494,7 +5488,7 @@ void mqtt_autoDiscovery_http_server(){
54945488 device[" model" ] = APPLICATION_NAME ;
54955489 device[" model_id" ] = deviceIdentity.data .product_id ;
54965490 device[" serial_number" ] = deviceIdentity.data .uuid ;
5497- device[" sw_version" ] = VERSION ;
5491+ device[" sw_version" ] = VERSION " ( " COMMIT_HASH " ) " ;
54985492 device[" configuration_url" ] = (" http://" + ETH .localIP ().toString ()).c_str ();
54995493
55005494 if (strlen (mqttClient.autoDiscovery .suggestedArea ) > 0 ){
@@ -5588,7 +5582,7 @@ void mqtt_autoDiscovery_heapFree(){
55885582 device[" model" ] = APPLICATION_NAME ;
55895583 device[" model_id" ] = deviceIdentity.data .product_id ;
55905584 device[" serial_number" ] = deviceIdentity.data .uuid ;
5591- device[" sw_version" ] = VERSION ;
5585+ device[" sw_version" ] = VERSION " ( " COMMIT_HASH " ) " ;
55925586 device[" configuration_url" ] = (" http://" + ETH .localIP ().toString ()).c_str ();
55935587
55945588 if (strlen (mqttClient.autoDiscovery .suggestedArea ) > 0 ){
@@ -5671,7 +5665,7 @@ void mqtt_autoDiscovery_heapLargestFreeBlock(){
56715665 device[" model" ] = APPLICATION_NAME ;
56725666 device[" model_id" ] = deviceIdentity.data .product_id ;
56735667 device[" serial_number" ] = deviceIdentity.data .uuid ;
5674- device[" sw_version" ] = VERSION ;
5668+ device[" sw_version" ] = VERSION " ( " COMMIT_HASH " ) " ;
56755669 device[" configuration_url" ] = (" http://" + ETH .localIP ().toString ()).c_str ();
56765670
56775671 if (strlen (mqttClient.autoDiscovery .suggestedArea ) > 0 ){
0 commit comments