Skip to content

Commit

Permalink
Build date in ota.py (mDNS) (xoseperez#1736)
Browse files Browse the repository at this point in the history
* include build_date in mdns (and ota.py)

* ota.py: correct number of dashes in header
  • Loading branch information
m-kozlowski authored and mcspr committed Jul 14, 2019
1 parent 98fbb8f commit 8dac0bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions code/espurna/mdns.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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());
{
Expand Down
7 changes: 5 additions & 2 deletions code/ota.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -76,20 +77,21 @@ 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",
"IP",
"MAC",
"APP",
"VERSION",
"BUILD_DATE",
"DEVICE",
"MEM_SIZE",
"SDK_SIZE",
"FREE_SPACE"
))
print("-" * 139)
print("-" * 164)

index = 0
for device in devices:
Expand All @@ -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),
Expand Down

0 comments on commit 8dac0bb

Please sign in to comment.