Public Member Functions | |
def | __init__ (self, pi, gpio, callback, timeout=5) |
Public Attributes | |
callback | |
cb | |
code_timeout | |
edges | |
gpio | |
hash_val | |
in_code | |
pi | |
t1 | |
t2 | |
t3 | |
t4 | |
Private Member Functions | |
def | _cb (self, gpio, level, tick) |
def | _hash (self, old_val, new_val) |
This class forms a hash over the IR pulses generated by an IR remote. The remote key press is not converted into a code in the manner of the lirc module. No attempt is made to decode the type of protocol used by the remote. The hash is likely to be unique for different keys and different remotes but this is not guaranteed. This hashing process works for some remotes/protocols but not for others. The only way to find out if it works for one or more of your remotes is to try it and see. EXAMPLE CODE #!/usr/bin/env python import time import pigpio import ir_hasher def callback(hash): print("hash={}".format(hash)); pi = pigpio.pi() ir = ir_hasher.hasher(pi, 7, callback, 5) print("ctrl c to exit"); time.sleep(300) pi.stop()
Definition at line 5 of file ir_hasher.py.
def ir_hasher.hasher.__init__ | ( | self, | |
pi, | |||
gpio, | |||
callback, | |||
timeout = 5 |
|||
) |
Initialises an IR remote hasher on a pi's gpio. A gap of timeout milliseconds indicates the end of the remote key press.
Definition at line 42 of file ir_hasher.py.
|
private |
Definition at line 73 of file ir_hasher.py.
|
private |
Definition at line 60 of file ir_hasher.py.
ir_hasher.hasher.callback |
Definition at line 52 of file ir_hasher.py.
ir_hasher.hasher.cb |
Definition at line 58 of file ir_hasher.py.
ir_hasher.hasher.code_timeout |
Definition at line 51 of file ir_hasher.py.
ir_hasher.hasher.edges |
Definition at line 85 of file ir_hasher.py.
ir_hasher.hasher.gpio |
Definition at line 50 of file ir_hasher.py.
ir_hasher.hasher.hash_val |
Definition at line 69 of file ir_hasher.py.
ir_hasher.hasher.in_code |
Definition at line 54 of file ir_hasher.py.
ir_hasher.hasher.pi |
Definition at line 49 of file ir_hasher.py.
ir_hasher.hasher.t1 |
Definition at line 87 of file ir_hasher.py.
ir_hasher.hasher.t2 |
Definition at line 88 of file ir_hasher.py.
ir_hasher.hasher.t3 |
Definition at line 89 of file ir_hasher.py.
ir_hasher.hasher.t4 |
Definition at line 90 of file ir_hasher.py.