Fix flake8 again
This commit is contained in:
parent
3b49bd5aa9
commit
ea2bc36a72
@ -49,12 +49,10 @@ class MQTTStat(threading.Thread):
|
||||
self.client.username_pw_set(auth['username'],
|
||||
password=auth.get('password'))
|
||||
|
||||
|
||||
def run(self):
|
||||
def on_connect(client, userdata, flags, rc):
|
||||
client.subscribe(self.mqtt_topic)
|
||||
|
||||
|
||||
def on_message(client, userdata, msg):
|
||||
if self.statsd_type == 'gauge':
|
||||
self.statsd_client.gauge(self.statsd_topic, msg.payload)
|
||||
@ -62,6 +60,7 @@ class MQTTStat(threading.Thread):
|
||||
self.statsd_client.timer(self.statsd_topic, msg.payload)
|
||||
elif self.statsd_type == 'counter':
|
||||
self.statsd_client.incr(self.statsd_topic)
|
||||
|
||||
self.client.on_connect = on_connect
|
||||
self.client.on_message = on_message
|
||||
self.client.connect(self.hostname, self.port)
|
||||
|
Loading…
x
Reference in New Issue
Block a user