Ejemplo n.º 1
0
    def test_decode_repeat_spec(self):
        # Create a decoder and "send" a frame
        decoder = NecDecoder()
        code = decoder.decode(TestNecDecoder.reference_pulses)

        repeat_response = decoder.decode(
            TestNecDecoder.reference_repeat_pulses)

        assert code == repeat_response
Ejemplo n.º 2
0
    def test_decode_repeat_spec_fast(self):
        decoder = NecDecoder()
        code = decoder.decode(TestNecDecoder.reference_pulses)

        repeat_command_fast = [
            pulse + pulse * TestNecDecoder.time_tolerance
            for pulse in TestNecDecoder.reference_repeat_pulses
        ]

        repeat_response = decoder.decode(repeat_command_fast)

        assert code == repeat_response
Ejemplo n.º 3
0
    def test_decode_spec_fast(self):
        pulses_slow = [
            pulse - pulse * TestNecDecoder.time_tolerance
            for pulse in TestNecDecoder.reference_pulses
        ]

        decoder = NecDecoder()

        assert decoder.decode(pulses_slow) == TestNecDecoder.reference_number
Ejemplo n.º 4
0
    def test_decode_spec_extended(self):
        decoder = NecDecoder(True)
        return_code = decoder.decode(TestNecDecoder.reference_pulses_extended)

        assert return_code == TestNecDecoder.reference_pulses_extended_number
Ejemplo n.º 5
0
    def test_decode_spec(self):
        decoder = NecDecoder()

        assert decoder.decode(
            TestNecDecoder.reference_pulses) == TestNecDecoder.reference_number