diff options
author | Devaev Maxim <[email protected]> | 2020-09-09 12:52:45 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-09-09 12:52:45 +0300 |
commit | 170ed92bd446a7dde3fedc2cb143d2a328f8a4cb (patch) | |
tree | a9b50ab83bffaa61066d657a7fc58f28df61cfda /kvmd/plugins/ugpio/gpio.py | |
parent | 04284584fecb279c5a1872d64697a3b26d04318c (diff) |
cleanup on driver side
Diffstat (limited to 'kvmd/plugins/ugpio/gpio.py')
-rw-r--r-- | kvmd/plugins/ugpio/gpio.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kvmd/plugins/ugpio/gpio.py b/kvmd/plugins/ugpio/gpio.py index 96c3eee7..90426e13 100644 --- a/kvmd/plugins/ugpio/gpio.py +++ b/kvmd/plugins/ugpio/gpio.py @@ -83,6 +83,11 @@ class Plugin(BaseUserGpioDriver): assert self.__reader await self.__reader.poll() + def cleanup(self) -> None: + for (pin, initial) in self.__output_pins.items(): + if initial is not None: + gpio.write(pin, initial) + def read(self, pin: int) -> bool: return gpio.read(pin) |