Collectd Plugin #13

Merged
sqozz merged 3 commits from cfr34k/sem6000:collectd into master 2020-05-02 19:26:20 +02:00
Showing only changes of commit 861079e997 - Show all commits

View file

@ -7,7 +7,7 @@ import time
import collectd import collectd
from sem6000 import SEMSocket from sem6000 import SEMSocket
import bluepy from bluepy.btle import BTLEDisconnectError
Outdated
Review

maybe just import the exception here? I don't know if it makes any performance difference but at least it would be less confusing why bluepy is needed in here.

maybe just import the exception here? I don't know if it makes any performance difference but at least it would be less confusing why bluepy is needed in here.

Sounds reasonable. I'll do that!

Sounds reasonable. I'll do that!
instances = [] instances = []
@ -75,7 +75,7 @@ def read_func():
collectd.info("sem6000: Connected.") collectd.info("sem6000: Connected.")
inst['socket'].getStatus() inst['socket'].getStatus()
except (SEMSocket.NotConnectedException, bluepy.btle.BTLEDisconnectError, BrokenPipeError) as e: except (SEMSocket.NotConnectedException, BTLEDisconnectError, BrokenPipeError) as e:
collectd.warning("sem6000: Exception caught: {}".format(e)) collectd.warning("sem6000: Exception caught: {}".format(e))
collectd.warning("sem6000: Restarting on next cycle...") collectd.warning("sem6000: Restarting on next cycle...")