fix(console): human-readable clock, fix repeater timeouts

- Clock command now shows datetime like meshcore-cli: "Current time: 2026-03-19 11:39:07 (1773916747)"
- Repeater req_* commands: pass timeout=0 to meshcore library so it uses
  device's suggested_timeout instead of hardcoded 30s (matching meshcore-cli behavior)
- Execute timeout raised to 120s to accommodate slow repeater responses

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2026-03-19 11:58:46 +01:00
parent 4f64cc92e5
commit fe7c67ee9a
2 changed files with 26 additions and 23 deletions
+19 -18
View File
@@ -1628,10 +1628,11 @@ class DeviceManager:
if not contact:
return {'success': False, 'error': f"Contact not found: {name_or_key}"}
try:
timeout = contact.get('timeout', 0) or 30
# Pass timeout=0 to let library use device's suggested_timeout
contact_timeout = contact.get('timeout', 0) or 0
event = self.execute(
self.mc.commands.req_status_sync(contact, timeout),
timeout=timeout + 5
self.mc.commands.req_status_sync(contact, contact_timeout),
timeout=120
)
if event and hasattr(event, 'payload'):
return {'success': True, 'data': event.payload}
@@ -1648,10 +1649,10 @@ class DeviceManager:
if not contact:
return {'success': False, 'error': f"Contact not found: {name_or_key}"}
try:
timeout = contact.get('timeout', 0) or 30
contact_timeout = contact.get('timeout', 0) or 0
event = self.execute(
self.mc.commands.req_regions_sync(contact, timeout),
timeout=timeout + 5
self.mc.commands.req_regions_sync(contact, contact_timeout),
timeout=120
)
if event and hasattr(event, 'payload'):
return {'success': True, 'data': event.payload}
@@ -1668,10 +1669,10 @@ class DeviceManager:
if not contact:
return {'success': False, 'error': f"Contact not found: {name_or_key}"}
try:
timeout = contact.get('timeout', 0) or 30
contact_timeout = contact.get('timeout', 0) or 0
event = self.execute(
self.mc.commands.req_owner_sync(contact, timeout),
timeout=timeout + 5
self.mc.commands.req_owner_sync(contact, contact_timeout),
timeout=120
)
if event and hasattr(event, 'payload'):
return {'success': True, 'data': event.payload}
@@ -1688,10 +1689,10 @@ class DeviceManager:
if not contact:
return {'success': False, 'error': f"Contact not found: {name_or_key}"}
try:
timeout = contact.get('timeout', 0) or 30
contact_timeout = contact.get('timeout', 0) or 0
event = self.execute(
self.mc.commands.req_acl_sync(contact, timeout),
timeout=timeout + 5
self.mc.commands.req_acl_sync(contact, contact_timeout),
timeout=120
)
if event and hasattr(event, 'payload'):
return {'success': True, 'data': event.payload}
@@ -1708,10 +1709,10 @@ class DeviceManager:
if not contact:
return {'success': False, 'error': f"Contact not found: {name_or_key}"}
try:
timeout = contact.get('timeout', 0) or 30
contact_timeout = contact.get('timeout', 0) or 0
event = self.execute(
self.mc.commands.req_basic_sync(contact, timeout),
timeout=timeout + 5
self.mc.commands.req_basic_sync(contact, contact_timeout),
timeout=120
)
if event and hasattr(event, 'payload'):
return {'success': True, 'data': event.payload}
@@ -1728,10 +1729,10 @@ class DeviceManager:
if not contact:
return {'success': False, 'error': f"Contact not found: {name_or_key}"}
try:
timeout = contact.get('timeout', 0) or 30
contact_timeout = contact.get('timeout', 0) or 0
event = self.execute(
self.mc.commands.req_mma_sync(contact, from_secs, to_secs, timeout),
timeout=timeout + 5
self.mc.commands.req_mma_sync(contact, from_secs, to_secs, contact_timeout),
timeout=120
)
if event and hasattr(event, 'payload'):
return {'success': True, 'data': event.payload}