[SOLVED] Error: got float, want string

I’m a novice developer. I’m trying to read the JSON response from a webserver and I’m close but am getting and error that looks like it is because I’m trying to render to my Pixlet a string when the variable is apparently a floating point number. I’m trying get the current temperature from a temperature/humidity sensor. The JSON data is fairly long and complex however all I want to get is the current temperature.

Here is my code

load(“render.star”, “render”)
load(“http.star”, “http”)

URL = “http://192.168.XX.XX/apps/api/615/devices/395?access_token=XXXXXXXXXXXX

def main():
rep = http.get(URL)
if rep.status_code != 200:
fail(“Request failed with status %d”, rep.status_code)

value = rep.json()["attributes"][4]["currentValue"]
return render.Root(
    child = render.Text(value)
)

Update: I figured out how to convert the number to a string with the str() function