def handle_poll_resp(data, modules): (text, msg) = HMTLprotocol.decode_msg(data) if isinstance(msg, HMTLprotocol.PollHdr): print("Poll response: dev=%d addr=%d" % (msg.device_id, msg.address)) modules.append(msg) else: print("Not a poll response, class: %s " % (msg.__class__.__name__))