From 473fa82ce09154ffdb9eae1615f6f75edc79930a Mon Sep 17 00:00:00 2001 From: Filip Dobrovolny Date: Sat, 22 Apr 2023 23:32:49 +0200 Subject: [PATCH] Fixes re appending of checksum to constant command values. --- src/mh_zxx/base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mh_zxx/base.py b/src/mh_zxx/base.py index 4d52e2b..716cc25 100644 --- a/src/mh_zxx/base.py +++ b/src/mh_zxx/base.py @@ -47,8 +47,7 @@ def _write_command(self, command: List[int]): """ Write command to the sensor. """ - command.append(self._checksum(command)) - self.serial.write(command) + self.serial.write(command + [self._checksum(command)]) def _read_response(self) -> bytes: """