Skip to content

Commit 63ca4bd

Browse files
committed
Use hours for engineering-mode --timeout and increase max value
1 parent 79cd122 commit 63ca4bd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### ✨ Improved
66

77
* Store engineering mode information in Redis so it can be restored when the actor restarts.
8+
* Change `engineering-mode enable --timeout` to use hours and increase the allowed maximum value.
89

910

1011
## 1.3.0 - January 30, 2025

python/lvmecp/actor/commands/engineering.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def engineering_mode():
6565
@click.option(
6666
"--timeout",
6767
"-t",
68-
type=click.FloatRange(min=0.1, max=86400),
69-
help="Timeout for the engineering mode. "
68+
type=click.FloatRange(min=0.1, max=300),
69+
help="Timeout for the engineering mode, in hours. "
7070
"If not passed, the default timeout is used.",
7171
)
7272
@click.option(
@@ -90,6 +90,9 @@ async def enable(
9090
actor = command.actor
9191
modbus = command.actor.plc.modbus
9292

93+
if timeout is not None:
94+
timeout = timeout * 3600
95+
9396
await command.actor.eng_mode(True, timeout=timeout)
9497
await asyncio.sleep(0.5) # Allow time for the e-mode task to run.
9598

0 commit comments

Comments
 (0)