diff --git a/beamerctl.py b/beamerctl.py index 147c243..5eb7840 100755 --- a/beamerctl.py +++ b/beamerctl.py @@ -19,10 +19,10 @@ def on_connect(client, userdata, flags, rc): log.debug("Connected with result code " + str(rc)) beamer_state = readBeamerState() - client.publish("foobar/oben/lounge/beamer/status", beamer_state, qos=1) + client.publish("foobar/oben/lounge/beamer/status", beamer_state, qos=1, retain=True) input_source = readInputSource() - client.publish("foobar/oben/lounge/beamer/source", input_source, qos=1) + client.publish("foobar/oben/lounge/beamer/source", input_source, qos=1, retain=True) client.subscribe("foobar/oben/lounge/beamer/action") @@ -117,8 +117,8 @@ def getArgs(): def periodicUpdate(): log.debug('run scheduled statusupdates') - client.publish("foobar/oben/lounge/beamer/status", readBeamerState(), qos=1) - client.publish("foobar/oben/lounge/beamer/source", readInputSource(), qos=1) + client.publish("foobar/oben/lounge/beamer/status", readBeamerState(), qos=1, retain=True) + client.publish("foobar/oben/lounge/beamer/source", readInputSource(), qos=1, retain=True) if __name__ == '__main__': @@ -161,9 +161,9 @@ if __name__ == '__main__': if (inputSourceChanged()): client.publish("foobar/oben/lounge/beamer/source", - input_source, qos=1) + input_source, qos=1, retain=True) if (beamerStatusChanged()): client.publish("foobar/oben/lounge/beamer/status", - beamer_state, qos=1) + beamer_state, qos=1, retain=True) time.sleep(1)