From: Roman Bazalevskiy Date: Tue, 31 Oct 2017 05:56:31 +0000 (+0300) Subject: Merge branch 'master' of rvb.name:openhab-process X-Git-Url: https://git.rvb.name/openhab-process.git/commitdiff_plain/dd22f2616ea394af68b81ce1872e9c00db50bbbb?hp=bb5d24ae6623bf629268bccea47ab9a2cac1aeef Merge branch 'master' of rvb.name:openhab-process --- 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