<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def decode_pir(packet, channel=1):
 """Decode a PIR."""

    val = str(packet.get(QSDATA, ''))
    if len(val) == 8 and val.startswith('0f') and channel == 1:
        return int(val[-4:], 16) > 0
    return None