Skip to content

Commit

Permalink
Merge pull request #80 from samson0v/master
Browse files Browse the repository at this point in the history
Fixed processing attribute requests
  • Loading branch information
imbeacon authored Oct 30, 2024
2 parents 256e5b9 + 685d78a commit 2a19f1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tb_device_mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,9 @@ def _split_message(message_pack, datapoints_max_count, max_payload_size):

return split_messages

def add_attrs_request_timeout(self, attr_request_number, timeout):
self.__attrs_request_timeout[attr_request_number] = timeout


class ProvisionClient(paho.Client):
PROVISION_REQUEST_TOPIC = "/provision/request"
Expand Down
2 changes: 1 addition & 1 deletion tb_gateway_mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def __request_attributes(self, device, keys, callback, type_is_client=False):
"id": attr_request_number}
info = self._send_device_request(TBSendMethod.PUBLISH, device, topic=GATEWAY_ATTRIBUTES_REQUEST_TOPIC, data=msg,
qos=1)
self.__attrs_request_timeout[attr_request_number] = int(time()) + 20
self.add_attrs_request_timeout(attr_request_number, int(time()) + 20)
return info

def _send_device_request(self, _type, device_name, **kwargs):
Expand Down

0 comments on commit 2a19f1a

Please sign in to comment.