From 8dac0bbe49fcf598c35a120cc5a35394d6f2b350 Mon Sep 17 00:00:00 2001 From: m-kozlowski <10508687+m-kozlowski@users.noreply.github.com> Date: Sun, 14 Jul 2019 23:42:12 +0200 Subject: [PATCH] Build date in ota.py (mDNS) (#1736) * include build_date in mdns (and ota.py) * ota.py: correct number of dashes in header --- code/espurna/mdns.ino | 1 + code/ota.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/espurna/mdns.ino b/code/espurna/mdns.ino index bc174ee6..ff8cb175 100644 --- a/code/espurna/mdns.ino +++ b/code/espurna/mdns.ino @@ -50,6 +50,7 @@ void mdnsServerSetup() { // Public ESPurna related txt for OTA discovery MDNS.addServiceTxt("arduino", "tcp", "app_name", APP_NAME); MDNS.addServiceTxt("arduino", "tcp", "app_version", APP_VERSION); + MDNS.addServiceTxt("arduino", "tcp", "build_date", buildTime()); MDNS.addServiceTxt("arduino", "tcp", "mac", WiFi.macAddress()); MDNS.addServiceTxt("arduino", "tcp", "target_board", getBoardName()); { diff --git a/code/ota.py b/code/ota.py index 5a7a49e0..9cd9edcf 100755 --- a/code/ota.py +++ b/code/ota.py @@ -55,6 +55,7 @@ def on_service_state_change(zeroconf, service_type, name, state_change): 'mac': '', 'app_name': '', 'app_version': '', + 'build_date': '', 'target_board': '', 'mem_size': 0, 'sdk_size': 0, @@ -76,7 +77,7 @@ def list_devices(): """ Shows the list of discovered devices """ - output_format = "{:>3} {:<14} {:<15} {:<17} {:<12} {:<12} {:<25} {:<8} {:<8} {:<10}" + output_format = "{:>3} {:<14} {:<15} {:<17} {:<12} {:<12} {:<20} {:<25} {:<8} {:<8} {:<10}" print(output_format.format( "#", "HOSTNAME", @@ -84,12 +85,13 @@ def list_devices(): "MAC", "APP", "VERSION", + "BUILD_DATE", "DEVICE", "MEM_SIZE", "SDK_SIZE", "FREE_SPACE" )) - print("-" * 139) + print("-" * 164) index = 0 for device in devices: @@ -101,6 +103,7 @@ def list_devices(): device.get('mac', ''), device.get('app_name', ''), device.get('app_version', ''), + device.get('build_date', ''), device.get('target_board', ''), device.get('mem_size', 0), device.get('sdk_size', 0),