cleanup on driver side

This commit is contained in:
Devaev Maxim
2020-09-09 12:52:45 +03:00
parent 04284584fe
commit 170ed92bd4
4 changed files with 49 additions and 37 deletions

View File

@@ -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)