From d54a4adaa1ef78cd3ef40398f0bc9fd23c60d8e4 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Wed, 16 Feb 2022 11:25:29 -0500 Subject: [PATCH 1/2] Update adafruit_irremote.py Fix the decode_bits() method in the object wrapper to return the IRMessage returned by the decode_bits() function. Otherwise decoder.decode_bits() is returning None. --- adafruit_irremote.py | 1 + 1 file changed, 1 insertion(+) diff --git a/adafruit_irremote.py b/adafruit_irremote.py index 4900b6b..14a5bbe 100644 --- a/adafruit_irremote.py +++ b/adafruit_irremote.py @@ -265,6 +265,7 @@ def decode_bits(self, pulses): # pylint: disable=no-self-use raise IRNECRepeatException() if isinstance(result, UnparseableIRMessage): raise IRDecodeException("10 pulses minimum") + return result def _read_pulses_non_blocking( self, input_pulses, max_pulse=10000, pulse_window=0.10 From b6efe6d8e428ed97947fcbbd3dab8cb474e479ed Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Wed, 16 Feb 2022 12:44:48 -0500 Subject: [PATCH 2/2] Return decode_bits() code rather than the message containing the code. Brings patch into compliance with published API. --- adafruit_irremote.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_irremote.py b/adafruit_irremote.py index 14a5bbe..f03cb7e 100644 --- a/adafruit_irremote.py +++ b/adafruit_irremote.py @@ -265,7 +265,7 @@ def decode_bits(self, pulses): # pylint: disable=no-self-use raise IRNECRepeatException() if isinstance(result, UnparseableIRMessage): raise IRDecodeException("10 pulses minimum") - return result + return result.code def _read_pulses_non_blocking( self, input_pulses, max_pulse=10000, pulse_window=0.10