@@ -25,7 +25,7 @@ def __init__(self, config, sensors):
2525
2626 # check for mandatory configuration
2727 if 'mqtt_host' not in self .conf or 'enocean_port' not in self .conf :
28- raise Exception ("Mandatory configuration not found: mqtt_host/enocean_port" )
28+ raise KeyError ("Mandatory configuration not found: mqtt_host/enocean_port" )
2929 mqtt_port = int (self .conf ['mqtt_port' ]) if 'mqtt_port' in self .conf else 1883
3030 mqtt_keepalive = int (self .conf ['mqtt_keepalive' ]) if 'mqtt_keepalive' in self .conf else 60
3131
@@ -69,7 +69,7 @@ def __del__(self):
6969 #=============================================================================================
7070 # MQTT CLIENT
7171 #=============================================================================================
72- def _on_connect (self , mqtt_client , _userdata , _flags , reason_code , properties ):
72+ def _on_connect (self , mqtt_client , _userdata , _flags , reason_code , _properties ):
7373 '''callback for when the client receives a CONNACK response from the MQTT server.'''
7474 if reason_code == 0 :
7575 logging .info ("Succesfully connected to MQTT broker." )
@@ -80,7 +80,7 @@ def _on_connect(self, mqtt_client, _userdata, _flags, reason_code, properties):
8080 else :
8181 logging .error ("Error connecting to MQTT broker: %s" , reason_code )
8282
83- def _on_disconnect (self , _mqtt_client , _userdata , _flags , reason_code , properties ):
83+ def _on_disconnect (self , _mqtt_client , _userdata , _flags , reason_code , _properties ):
8484 '''callback for when the client disconnects from the MQTT server.'''
8585 if reason_code == 0 :
8686 logging .warning ("Successfully disconnected from MQTT broker" )
0 commit comments