mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-01 10:31:54 +08:00
ugpio plugins
This commit is contained in:
@@ -61,16 +61,16 @@ def _clear_gpio(config: Section) -> None:
|
||||
("streamer/cap", config.streamer.cap_pin),
|
||||
("streamer/conv", config.streamer.conv_pin),
|
||||
|
||||
*([
|
||||
(f"gpio/{channel}", params.pin)
|
||||
for (channel, params) in config.gpio.scheme.items()
|
||||
if params.mode == "output"
|
||||
]),
|
||||
# *([
|
||||
# (f"gpio/{channel}", params.pin)
|
||||
# for (channel, params) in config.gpio.scheme.items()
|
||||
# if params.mode == "output"
|
||||
# ]),
|
||||
]:
|
||||
if pin >= 0:
|
||||
logger.info("Writing 0 to GPIO pin=%d (%s)", pin, name)
|
||||
try:
|
||||
gpio.set_output(pin, initial=False)
|
||||
gpio.set_output(pin, False)
|
||||
except Exception:
|
||||
logger.exception("Can't clear GPIO pin=%d (%s)", pin, name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user