Skip to content

Commit 196bfb8

Browse files
committed
Remove error message if no_gw_status is set
1 parent b8bf799 commit 196bfb8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

wirepas_mqtt_library/wirepas_network_interface.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ def _on_connect_callback(self, client, userdata, flags, rc):
238238
self._task_queue.add_task(self._connection_cb, False, self.ConnectionErrorCode.from_broker_connack(rc))
239239
return
240240

241-
# Register for Gateway status topic
242241
if not self._no_gw_status:
242+
# Register for Gateway status topic
243243
all_gateway_status_topic = TopicGenerator.make_status_topic()
244244
self._mqtt_client.subscribe(all_gateway_status_topic, qos=1)
245245
self._mqtt_client.message_callback_add(all_gateway_status_topic,
@@ -335,7 +335,10 @@ def _update_sink_config(self, gw_id, config):
335335
self._task_queue.add_task(self._on_config_changed_cb)
336336

337337
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")
339342

340343
def _update_gateway_configs(self, config):
341344
try:
@@ -345,7 +348,10 @@ def _update_gateway_configs(self, config):
345348
if self._on_config_changed_cb is not None:
346349
self._task_queue.add_task(self._on_config_changed_cb)
347350
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")
349355

350356
def _on_data_received(self, client, userdata, message):
351357
try:

0 commit comments

Comments
 (0)