mirror of
https://github.com/lumapu/ahoy.git
synced 2025-04-30 02:36:20 +02:00
RPI: avoid error if mqtt is not defined
If MQTT is not defined in ahoy.yml, ahoy send an AttributeError
This commit is contained in:
parent
d9eaafea6b
commit
4df6eab987
1 changed files with 2 additions and 2 deletions
|
@ -345,8 +345,8 @@ if __name__ == '__main__':
|
||||||
if global_config.verbose:
|
if global_config.verbose:
|
||||||
hoymiles.HOYMILES_DEBUG_LOGGING=True
|
hoymiles.HOYMILES_DEBUG_LOGGING=True
|
||||||
|
|
||||||
mqtt_config = ahoy_config.get('mqtt', [])
|
mqtt_config = ahoy_config.get('mqtt', {})
|
||||||
if not mqtt_config.get('disabled', False):
|
if mqtt_config and not mqtt_config.get('disabled', False):
|
||||||
mqtt_client = paho.mqtt.client.Client()
|
mqtt_client = paho.mqtt.client.Client()
|
||||||
|
|
||||||
if mqtt_config.get('useTLS',False):
|
if mqtt_config.get('useTLS',False):
|
||||||
|
|
Loading…
Add table
Reference in a new issue