]>
vault307.fbx.one Git - ir_decoder.git/blob - validate_code.py
1 class InvalidCodeException(Exception):
5 def validate_code(code
):
7 raise InvalidCodeException
10 raise InvalidCodeException
12 # check 8-bit device address
13 # following 8-bits have to be a logical inverse of the device address
15 if code
[i
] == code
[i
+ 8]:
16 raise InvalidCodeException
19 # following 8-bits have to be a logical inverse of the command
20 for i
in range(16, 24):
21 if code
[i
] == code
[i
+ 8]:
22 raise InvalidCodeException