@@ -1050,13 +1050,14 @@ def _wait_until_current_queued_messages_processed(self):
10501050
10511051 def _send_request (self , _type , kwargs , timeout = DEFAULT_TIMEOUT , device = None ,
10521052 msg_rate_limit = None , dp_rate_limit = None ):
1053+ topic = kwargs ['topic' ]
10531054 if msg_rate_limit is None :
1054- if kwargs . get ( ' topic' ) == TELEMETRY_TOPIC :
1055+ if topic == TELEMETRY_TOPIC or topic == ATTRIBUTES_TOPIC :
10551056 msg_rate_limit = self ._telemetry_rate_limit
10561057 else :
10571058 msg_rate_limit = self ._messages_rate_limit
10581059 if dp_rate_limit is None :
1059- if kwargs . get ( ' topic' ) == TELEMETRY_TOPIC :
1060+ if topic == TELEMETRY_TOPIC or topic == ATTRIBUTES_TOPIC :
10601061 dp_rate_limit = self ._telemetry_dp_rate_limit
10611062 else :
10621063 dp_rate_limit = self .EMPTY_RATE_LIMIT
@@ -1101,7 +1102,7 @@ def __send_publish_with_limitations(self, kwargs, timeout, device=None, msg_rate
11011102 data = kwargs .get ("payload" )
11021103 if isinstance (data , str ):
11031104 data = loads (data )
1104- topic = kwargs . get ( "topic" , '' )
1105+ topic = kwargs [ "topic" ]
11051106 attributes_format = topic .endswith ('attributes' )
11061107 if topic .endswith ('telemetry' ) or attributes_format :
11071108 if device is None or data .get (device ) is None :
0 commit comments