commit ae6da7226f443681727a0828df1f49e57ef9a331
parent 89ccd188ffceb24a590b410f3d14a2b598f49d15
Author: Brian C. Lane <bcl@brianlane.com>
Date: Sun, 23 Jun 2019 14:46:42 -0700
Allow new 'camera' keyword alias for 'thread'
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/strix/motion/config.py b/src/strix/motion/config.py
@@ -43,8 +43,8 @@ class MotionConfig():
try:
k, v = s.strip().split(" ", 1)
- # thread is a special case, can be more than 1
- if k == "thread":
+ # thread|camera is a special case, can be more than 1
+ if k == "thread" or k == "camera":
k = self.thread_n()
except ValueError:
k = s
@@ -64,7 +64,7 @@ class MotionConfig():
def __init__(self, config_path: str) -> None:
self.config = self.parse(config_path)
- for t in filter(lambda k: k.startswith("thread"), self.config.keys()):
+ for t in filter(lambda k: k.startswith("thread") or k.startswith("camera"), self.config.keys()):
thread_path = self.config[t]
if not thread_path.startswith("/"):
# Turn the relative path into an absolute one using the config_path