While trying the email alert project along with the temperature monitoring system, a doubt came to my mind. In the screenshot of the code attached below, what does the function send_email (in line 21) return? Also, why is the JSON data type returned by the analogRead function passed to the loads function using the statement: data=json.loads(response), as in line 14, while the returned data of the send_email function is passed with the statement: response_text=json.loads(response.text), as in line 23? I am confused as to why the value returned by the analogRead function is passed directly as ‘response’ only, while the value returned by the send_email function is passed as ‘response.text’?
Here is the screenshot of my code: