Open thecabinet opened 6 days ago
@thecabinet, Thank you for your inquiry. Could you please share the client
that you used when creating the ThinQMQTTClient
object in the code you provided? I can look into it for you. Since it contains personal information, please send it to the email address thinq-connect@lge.com. Thank you!
@thecabinet, I have received your email. Please note that I will respond here. I have checked the API called by you, and the client registration has been done properly. However, in order to receive the push/event messages from the devices via MQTT, you first need to query the device list, followed by querying the profile and status, and then call the subscription APIs for each device.
Please refer to the code flow below. As the SDK is still in its early stages of release, I kindly ask for your understanding that the detailed documentation is currently being prepared.
device_list = await thinq_api.async_get_device_list()
logger.info("device_list : %s", device_list)
for device in device_list:
logger.info("device : %s", device)
device_id = device.get("deviceId")
profile = await thinq_api.async_get_device_profile(device_id)
logger.info("profile : %s", profile)
status = await thinq_api.async_get_device_status(device_id)
logger.info("status : %s", status)
response = await thinq_api.async_post_push_subscribe(device_id)
logger.info("push subscribe : %s", response)
response = await thinq_api.async_post_event_subscribe(device_id)
logger.info("event subscribe : %s", response)
Can you provide some example code for how to use ThinQMQTTClient? I assume this is intended to allow users to receive push notifications instead of polling with ThinQApi.
I've tried:
I've defined similar functions for all the callbacks (per the signatures at https://awslabs.github.io/aws-crt-python/api/mqtt.html#awscrt.mqtt.Connection) and I see my
on_connection_success
handler getting called, but neveron_message_received
, even when I'm sleeping through periods when my app receives a notification.