X-Git-Url: https://git.rvb.name/openhab-process.git/blobdiff_plain/dec6ca23b56d7ce8f5e535c421c540029c104297..33e4de673cfc18d5dbb46d56f5b7453329cf7e89:/mqtt-agi/mqtt?ds=sidebyside diff --git a/mqtt-agi/mqtt b/mqtt-agi/mqtt index 6f69c7e..cbb3e25 100755 --- a/mqtt-agi/mqtt +++ b/mqtt-agi/mqtt @@ -13,8 +13,12 @@ import paho.mqtt.client as paho import json +from os import getpid,uname from pprint import pprint +client_name='agi-'+uname()[1]+'-'+str(getpid()) +print client_name + conffile, topic = sys.argv[1:3] config = ConfigParser() @@ -55,7 +59,7 @@ def on_publish(mosq, *args): # done agi_exit(0) -client = paho.Client('agi') +client = paho.Client(client_name) client.username_pw_set(mqtt_username, mqtt_password) client.connect(mqtt_server, port=mqtt_port) client.on_connect = on_connect