From 7b7eb62535ac2d5ce2370ffec482e73e3eda77db Mon Sep 17 00:00:00 2001 From: Benjamin Braatz Date: Mon, 3 Jan 2022 13:04:43 +0100 Subject: [PATCH] Poll input cards (in case of unreliable interrupt). --- controlpi_plugins/pcf8574.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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() -- 2.34.1