From: Benjamin Braatz Date: Mon, 3 Jan 2022 12:04:43 +0000 (+0100) Subject: Poll input cards (in case of unreliable interrupt). X-Git-Url: http://git.graph-it.com/?a=commitdiff_plain;h=7b7eb62535ac2d5ce2370ffec482e73e3eda77db;p=graphit%2Fcontrolpi-pinio.git Poll input cards (in case of unreliable interrupt). --- diff --git a/controlpi_plugins/pcf8574.py b/controlpi_plugins/pcf8574.py index fe3924e..d981440 100644 --- a/controlpi_plugins/pcf8574.py +++ b/controlpi_plugins/pcf8574.py @@ -166,5 +166,7 @@ class InputCard(BasePlugin): 'state': new_state})) async def run(self) -> None: - """Run no code proactively.""" - pass + """Poll I2C state (in case interrupt doesn't work).""" + while True: + await asyncio.sleep(0.05) + self._read()