Complete the code to update the device shadow state with the reported temperature.
shadow_update = {"state": {"reported": {"temperature": [1]The reported temperature value should be a number, so use 22 without quotes.
Complete the code to retrieve the desired state from the device shadow JSON.
desired_state = shadow_document["state"][[1]]
To get the desired state, access the "desired" key inside the "state" object.
Fix the error in the code to correctly publish the shadow update to the MQTT topic.
mqtt_client.publish("$aws/things/[1]/shadow/update", json.dumps(shadow_update))
The MQTT topic requires the thing name, which is usually stored in 'thing_name' variable.
Fill both blanks to create a dictionary comprehension that filters reported states with temperature above 25.
{k: v for k, v in shadow_state[[1]].items() if v [2] 25}We want to filter the 'reported' states where the value is greater than 25.
Fill all three blanks to create a shadow update payload with desired humidity set to 60 and reported temperature unchanged.
shadow_payload = {"state": {"desired": {"humidity": [1], "reported": {"temperature": [2], "clientToken": [3]The desired humidity is 60 (number), temperature uses current_temp variable, and clientToken is a string token.