From a7bede76efd42f3896be70417b0d585462772c8d Mon Sep 17 00:00:00 2001 From: Henrik Nilsson <48586752+henrik-nil-acc@users.noreply.github.com> Date: Mon, 25 Mar 2024 19:40:53 +0100 Subject: [PATCH] Handle re-opening a closed bus (#107) --- smbus2/smbus2.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/smbus2/smbus2.py b/smbus2/smbus2.py index e9d7477..6ed471e 100644 --- a/smbus2/smbus2.py +++ b/smbus2/smbus2.py @@ -318,6 +318,8 @@ def close(self): os.close(self.fd) self.fd = None self._pec = 0 + self.address = None + self._force_last = None def _get_pec(self): return self._pec