mirror of
https://github.com/alexhopeoconnor/SunGather.git
synced 2026-10-04 02:48:12 +10:00
fix mqtt none type error
This commit is contained in:
@@ -68,8 +68,11 @@ class export_mqtt(object):
|
||||
return name.lower().replace(' ','_')
|
||||
|
||||
def publish(self, inverter):
|
||||
if not self.mqtt_client.is_connected():
|
||||
logging.warning(f'MQTT: Server Disconnected; {self.mqtt_queue.__len__()} messages queued, will automatically attempt to reconnect')
|
||||
try:
|
||||
if not self.mqtt_client.is_connected():
|
||||
logging.warning(f'MQTT: Server Disconnected; {self.mqtt_queue.__len__()} messages queued, will automatically attempt to reconnect')
|
||||
except Exception as err:
|
||||
logging.warning(f'MQTT: Server Error; Server not configured')
|
||||
# qos=0 is set, so no acknowledgment is sent, rending this check useless
|
||||
#elif self.mqtt_queue.__len__() > 10:
|
||||
# logging.warning(f'MQTT: {self.mqtt_queue.__len__()} messages queued, this may be due to a MQTT server issue')
|
||||
|
||||
Reference in New Issue
Block a user