From 0d5e8e645ff19fa3c4db62fa578584133f801e9e Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Sun, 3 Jan 2021 18:40:21 +0100 Subject: [PATCH] Revert "protocols: fix off-by-one in payload extraction" This reverts commit 0e020f2aa47391d8c5ec6e507ddde097f18b1ab8. Nothing needed fixing here. This strips off one byte too many. --- stcgal/protocols.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stcgal/protocols.py b/stcgal/protocols.py index f43a6b8..6ce408a 100644 --- a/stcgal/protocols.py +++ b/stcgal/protocols.py @@ -417,7 +417,7 @@ class Stc89Protocol(StcBaseProtocol): raise StcFramingException("packet checksum mismatch") payload = StcBaseProtocol.extract_payload(self, packet) - return payload[:-2] + return payload[:-1] def write_packet(self, packet_data): """Send packet to MCU. @@ -812,7 +812,7 @@ class Stc12BaseProtocol(StcBaseProtocol): raise StcFramingException("packet checksum mismatch") payload = StcBaseProtocol.extract_payload(self, packet) - return payload[:-3] + return payload[:-2] def write_packet(self, packet_data): """Send packet to MCU.