Skip to content

Commit fb4eac9

Browse files
authored
adapt to awscrt.mqtt on-message callbacks taking additional args (#156)
Also update awscrt version
1 parent 7a5a6e4 commit fb4eac9

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

awsiot/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def on_suback(suback_future):
132132
except Exception as e:
133133
future.set_exception(e)
134134

135-
def callback_wrapper(topic, payload, **kwargs):
135+
def callback_wrapper(topic, payload, dup, qos, retain, **kwargs):
136136
try:
137137
payload_obj = json.loads(payload.decode())
138138
event = payload_to_class_fn(payload_obj)

samples/basic_discovery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def try_iot_endpoints():
9898

9999
if args.mode == 'both' or args.mode == 'subscribe':
100100

101-
def on_publish(topic, payload, **kwargs):
101+
def on_publish(topic, payload, dup, qos, retain, **kwargs):
102102
print('Publish received on topic {}'.format(topic))
103103
print(payload)
104104

samples/pubsub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def on_resubscribe_complete(resubscribe_future):
7676

7777

7878
# Callback when the subscribed topic receives a message
79-
def on_message_received(topic, payload, **kwargs):
79+
def on_message_received(topic, payload, dup, qos, retain, **kwargs):
8080
print("Received message from topic '{}': {}".format(topic, payload))
8181
global received_count
8282
received_count += 1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"Operating System :: OS Independent",
2020
],
2121
install_requires=[
22-
'awscrt==0.9.15',
22+
'awscrt==0.10.6',
2323
],
2424
python_requires='>=3.5',
2525
)

0 commit comments

Comments
 (0)