summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/op_mode/powerctrl.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/op_mode/powerctrl.py b/src/op_mode/powerctrl.py
index 8de25d752..a6188ec74 100755
--- a/src/op_mode/powerctrl.py
+++ b/src/op_mode/powerctrl.py
@@ -27,7 +27,10 @@ from vyos.util import ask_yes_no
def parse_time(s):
try:
- return datetime.strptime(s, "%H:%M").time()
+ if re.match(r'^\d{1,2}$', s):
+ return datetime.strptime(s, "%M").time()
+ else:
+ return datetime.strptime(s, "%H:%M").time()
except ValueError:
return None