summaryrefslogtreecommitdiff
path: root/kvmd/apps/cleanup/__init__.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2019-04-06 05:32:02 +0300
committerDevaev Maxim <[email protected]>2019-04-06 08:04:26 +0300
commit1d75b738a08c98a5d3d8ac3c685e77360f4c1267 (patch)
tree3aa89dc7fd0ab737e9332714a784e9d4dde0a362 /kvmd/apps/cleanup/__init__.py
parent73e04b71ed55a46c939f12548b31746617af2bca (diff)
validators, tests
Diffstat (limited to 'kvmd/apps/cleanup/__init__.py')
-rw-r--r--kvmd/apps/cleanup/__init__.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/kvmd/apps/cleanup/__init__.py b/kvmd/apps/cleanup/__init__.py
index b39559f6..39bd7a71 100644
--- a/kvmd/apps/cleanup/__init__.py
+++ b/kvmd/apps/cleanup/__init__.py
@@ -24,6 +24,9 @@ import os
import subprocess
import time
+from typing import List
+from typing import Optional
+
from ...logging import get_logger
from ... import gpio
@@ -32,8 +35,8 @@ from .. import init
# =====
-def main() -> None:
- config = init("kvmd-cleanup", description="Kill KVMD and clear resources")[2].kvmd
+def main(argv: Optional[List[str]]=None) -> None:
+ config = init("kvmd-cleanup", description="Kill KVMD and clear resources", argv=argv)[2].kvmd
logger = get_logger(0)
logger.info("Cleaning up ...")
@@ -47,7 +50,7 @@ def main() -> None:
("streamer_cap_pin", config.streamer.cap_pin),
("streamer_conv_pin", config.streamer.conv_pin),
]:
- if pin > 0:
+ if pin >= 0:
logger.info("Writing value=0 to pin=%d (%s)", pin, name)
gpio.set_output(pin, initial=False)