Browse Source

Build date in ota.py (mDNS) (#1736)

* include build_date in mdns (and ota.py)

* ota.py: correct number of dashes in header
master
m-kozlowski 5 years ago
committed by Max Prokhorov
parent
commit
8dac0bbe49
2 changed files with 6 additions and 2 deletions
  1. +1
    -0
      code/espurna/mdns.ino
  2. +5
    -2
      code/ota.py

+ 1
- 0
code/espurna/mdns.ino View File

@ -50,6 +50,7 @@ void mdnsServerSetup() {
// Public ESPurna related txt for OTA discovery // Public ESPurna related txt for OTA discovery
MDNS.addServiceTxt("arduino", "tcp", "app_name", APP_NAME); MDNS.addServiceTxt("arduino", "tcp", "app_name", APP_NAME);
MDNS.addServiceTxt("arduino", "tcp", "app_version", APP_VERSION); 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", "mac", WiFi.macAddress());
MDNS.addServiceTxt("arduino", "tcp", "target_board", getBoardName()); MDNS.addServiceTxt("arduino", "tcp", "target_board", getBoardName());
{ {


+ 5
- 2
code/ota.py View File

@ -55,6 +55,7 @@ def on_service_state_change(zeroconf, service_type, name, state_change):
'mac': '', 'mac': '',
'app_name': '', 'app_name': '',
'app_version': '', 'app_version': '',
'build_date': '',
'target_board': '', 'target_board': '',
'mem_size': 0, 'mem_size': 0,
'sdk_size': 0, 'sdk_size': 0,
@ -76,7 +77,7 @@ def list_devices():
""" """
Shows the list of discovered 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( print(output_format.format(
"#", "#",
"HOSTNAME", "HOSTNAME",
@ -84,12 +85,13 @@ def list_devices():
"MAC", "MAC",
"APP", "APP",
"VERSION", "VERSION",
"BUILD_DATE",
"DEVICE", "DEVICE",
"MEM_SIZE", "MEM_SIZE",
"SDK_SIZE", "SDK_SIZE",
"FREE_SPACE" "FREE_SPACE"
)) ))
print("-" * 139)
print("-" * 164)
index = 0 index = 0
for device in devices: for device in devices:
@ -101,6 +103,7 @@ def list_devices():
device.get('mac', ''), device.get('mac', ''),
device.get('app_name', ''), device.get('app_name', ''),
device.get('app_version', ''), device.get('app_version', ''),
device.get('build_date', ''),
device.get('target_board', ''), device.get('target_board', ''),
device.get('mem_size', 0), device.get('mem_size', 0),
device.get('sdk_size', 0), device.get('sdk_size', 0),


Loading…
Cancel
Save