def set_last_will(self, topic, msg, retain=False, qos=0):
    assert (0 <= qos <= 2)
    assert topic
    self.lw_topic = topic
    self.lw_msg = msg
    self.lw_qos = qos
    self.lw_retain = retain
def set_last_will(self, topic, msg, retain=False, qos=0):
    assert (0 <= qos <= 2)
    assert topic
    self.lw_topic = topic
    self.lw_msg = msg
    self.lw_qos = qos
    self.lw_retain = retain