diff options
author | Devaev Maxim <[email protected]> | 2019-09-12 01:53:25 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2019-09-12 01:53:25 +0300 |
commit | ab7a16a4f7afb2393f69a7ac9b3f5cea7c3ed4d6 (patch) | |
tree | f94b97528ba2ffc18dacc2473908f0759e0e7329 /kvmd/apps/cleanup/__init__.py | |
parent | ca2eabc01f7294bd6fe35c734580ada91a2230a1 (diff) |
msd plugins
Diffstat (limited to 'kvmd/apps/cleanup/__init__.py')
-rw-r--r-- | kvmd/apps/cleanup/__init__.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/kvmd/apps/cleanup/__init__.py b/kvmd/apps/cleanup/__init__.py index 680f080b..d7790b67 100644 --- a/kvmd/apps/cleanup/__init__.py +++ b/kvmd/apps/cleanup/__init__.py @@ -47,20 +47,25 @@ def main(argv: Optional[List[str]]=None) -> None: logger.info("Cleaning up ...") with gpio.bcm(): - for (name, pin, enabled) in [ + for (name, pin) in [ *([ - ("hid_reset_pin", config.hid.reset_pin, True), + ("tty_hid_reset_pin", config.hid.reset_pin), ] if config.hid.type == "tty" else []), + *([ - ("atx_power_switch_pin", config.atx.power_switch_pin, True), - ("atx_reset_switch_pin", config.atx.reset_switch_pin, True), + ("gpio_atx_power_switch_pin", config.atx.power_switch_pin), + ("gpio_atx_reset_switch_pin", config.atx.reset_switch_pin), ] if config.atx.type == "gpio" else []), - ("msd_target_pin", config.msd.target_pin, config.msd.enabled), - ("msd_reset_pin", config.msd.reset_pin, config.msd.enabled), - ("streamer_cap_pin", config.streamer.cap_pin, True), - ("streamer_conv_pin", config.streamer.conv_pin, True), + + *([ + ("relay_msd_target_pin", config.msd.target_pin), + ("relay_msd_reset_pin", config.msd.reset_pin), + ] if config.msd.type == "relay" else []), + + ("streamer_cap_pin", config.streamer.cap_pin), + ("streamer_conv_pin", config.streamer.conv_pin), ]: - if enabled and pin >= 0: + if pin >= 0: logger.info("Writing value=0 to GPIO pin=%d (%s)", pin, name) try: gpio.set_output(pin, initial=False) |