Skip to content
This repository was archived by the owner on Aug 4, 2020. It is now read-only.

Commit b32c36c

Browse files
committed
XB-27 remove device status data publishes (like version, backoff index, publish counter)
1 parent 4912748 commit b32c36c

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

xi_client/xively_client.py

-25
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,6 @@ def __init__(self):
366366
self._thread = None
367367
self._routine = None
368368

369-
self._is_first_connect = True
370-
371369
def __del__(self):
372370

373371
self._cbHandler.remove_listener(self._get_control_topic_name(), self._boHandler)
@@ -420,7 +418,6 @@ def _routine_waiting_for_control_subscription_result(self):
420418
def _routine_connected(self):
421419
self._mqtt_loop()
422420
self._try_cooldown()
423-
self._send_publish_count_periodically()
424421

425422

426423
def _routine_rejected(self):
@@ -537,20 +534,6 @@ def _routine_reconnect(self):
537534

538535
time.sleep(1.0)
539536

540-
def _send_publish_count_periodically(self):
541-
if float(self._options.publish_count_send_time_period) > 0.0 and \
542-
(time.time() - self._last_publish_count_send_time >= float(self._options.publish_count_send_time_period)):
543-
current_publish_count = XivelyClient.publish_count_until_last_stat_message
544-
XivelyClient.publish_count_until_last_stat_message = 0
545-
self._publish_device_status_data("Publish count: " + str( current_publish_count ), 0, False)
546-
self._last_publish_count_send_time = time.time()
547-
548-
549-
def _publish_device_status_data(self, payload=None, qos=0, retain=False):
550-
# just a forwarder function to make us able to easiliy disable device status data publishes
551-
#self.publish(self._get_device_status_topic_name(), payload, qos, retain)
552-
pass
553-
554537

555538
def _mqtt_on_connected(self, previous_connection_result):
556539

@@ -559,14 +542,6 @@ def _mqtt_on_connected(self, previous_connection_result):
559542
# subscribe for control topic
560543
result, self._control_request_id = self._mqtt.subscribe([(self._get_control_topic_name(), 1)])
561544

562-
if self._is_first_connect:
563-
# publish device status data
564-
self._publish_device_status_data("Client library version: " + XivelyClientVersion.get_version_string(), 0, False)
565-
self._is_first_connect = False
566-
567-
self._publish_device_status_data("Last connection return code: " + str( previous_connection_result ), 0, False)
568-
self._publish_device_status_data("Backoff index: " + str( XivelyBackoff.backoff_lut_i ), 0, False)
569-
570545
# start timeout for control topic SUBACK
571546
self._routine = self._routine_waiting_for_control_subscription_result
572547

0 commit comments

Comments
 (0)