mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-08-12 11:42:56 +02:00
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:
+19
-18
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user