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

Commit

Permalink
XB-27 remove device status data publishes (like version, backoff inde…
Browse files Browse the repository at this point in the history
…x, publish counter)
  • Loading branch information
atigyi committed Jan 14, 2016
1 parent 4912748 commit b32c36c
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions xi_client/xively_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,6 @@ def __init__(self):
self._thread = None
self._routine = None

self._is_first_connect = True

def __del__(self):

self._cbHandler.remove_listener(self._get_control_topic_name(), self._boHandler)
Expand Down Expand Up @@ -420,7 +418,6 @@ def _routine_waiting_for_control_subscription_result(self):
def _routine_connected(self):
self._mqtt_loop()
self._try_cooldown()
self._send_publish_count_periodically()


def _routine_rejected(self):
Expand Down Expand Up @@ -537,20 +534,6 @@ def _routine_reconnect(self):

time.sleep(1.0)

def _send_publish_count_periodically(self):
if float(self._options.publish_count_send_time_period) > 0.0 and \
(time.time() - self._last_publish_count_send_time >= float(self._options.publish_count_send_time_period)):
current_publish_count = XivelyClient.publish_count_until_last_stat_message
XivelyClient.publish_count_until_last_stat_message = 0
self._publish_device_status_data("Publish count: " + str( current_publish_count ), 0, False)
self._last_publish_count_send_time = time.time()


def _publish_device_status_data(self, payload=None, qos=0, retain=False):
# just a forwarder function to make us able to easiliy disable device status data publishes
#self.publish(self._get_device_status_topic_name(), payload, qos, retain)
pass


def _mqtt_on_connected(self, previous_connection_result):

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

if self._is_first_connect:
# publish device status data
self._publish_device_status_data("Client library version: " + XivelyClientVersion.get_version_string(), 0, False)
self._is_first_connect = False

self._publish_device_status_data("Last connection return code: " + str( previous_connection_result ), 0, False)
self._publish_device_status_data("Backoff index: " + str( XivelyBackoff.backoff_lut_i ), 0, False)

# start timeout for control topic SUBACK
self._routine = self._routine_waiting_for_control_subscription_result

Expand Down

2 comments on commit b32c36c

@milgra
Copy link

@milgra milgra commented on b32c36c Feb 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we worked so much on these features :( but its okay

@atigyi
Copy link
Author

@atigyi atigyi commented on b32c36c Feb 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😢 😭

Please sign in to comment.