@@ -238,8 +238,8 @@ def _on_connect_callback(self, client, userdata, flags, rc):
238
238
self ._task_queue .add_task (self ._connection_cb , False , self .ConnectionErrorCode .from_broker_connack (rc ))
239
239
return
240
240
241
- # Register for Gateway status topic
242
241
if not self ._no_gw_status :
242
+ # Register for Gateway status topic
243
243
all_gateway_status_topic = TopicGenerator .make_status_topic ()
244
244
self ._mqtt_client .subscribe (all_gateway_status_topic , qos = 1 )
245
245
self ._mqtt_client .message_callback_add (all_gateway_status_topic ,
@@ -335,7 +335,10 @@ def _update_sink_config(self, gw_id, config):
335
335
self ._task_queue .add_task (self ._on_config_changed_cb )
336
336
337
337
except KeyError :
338
- logging .error ("Receiving sink config that is unknown %s/%s" , gw_id , config ["sink_id" ])
338
+ if not self ._no_gw_status :
339
+ logging .error ("Receiving sink config that is unknown %s/%s" , gw_id , config ["sink_id" ])
340
+ else :
341
+ logging .info ("Sink config received but flag no_gw_status set" )
339
342
340
343
def _update_gateway_configs (self , config ):
341
344
try :
@@ -345,7 +348,10 @@ def _update_gateway_configs(self, config):
345
348
if self ._on_config_changed_cb is not None :
346
349
self ._task_queue .add_task (self ._on_config_changed_cb )
347
350
except KeyError :
348
- logging .error ("Receiving gateway config that is unknown %s" , config .gw_id )
351
+ if not self ._no_gw_status :
352
+ logging .error ("Receiving gateway config that is unknown %s" , config .gw_id )
353
+ else :
354
+ logging .info ("Gateway config received but flag no_gw_status set" )
349
355
350
356
def _on_data_received (self , client , userdata , message ):
351
357
try :
0 commit comments