micropython / micropython-lib

Core Python libraries ported to MicroPython
Other
2.4k stars 997 forks source link

Hey I want to ask where is the code about xively in esp8266? #100

Closed michaelllh closed 8 years ago

michaelllh commented 8 years ago

Hey ,I want to ask whcih file in esp8266's floder describe the xively ,Thank you for your answer!

dpgeorge commented 8 years ago

There is no specific support for xively in the code base, but you can easily do it with the urequests module, something like this:

import urequests
def put_to_xively(channel, value):
    json = {"version":"1.0.0", "datastreams":[{"id":str(channel), "current_value":str(value)}]}
    resp = urequests.put("your xively API url", json=json)
    resp.close()
michaelllh commented 8 years ago

Thank you !

发自网易邮箱大师 在2016年09月12日 15:45,Damien George 写道:

There is no specific support for xively in the code base, but you can easily do it with the urequests module, something like this:

import urequests defput_to_xively(channel, value): json = {"version":"1.0.0", "datastreams":[{"id":str(channel), "current_value":str(value)}]} resp = urequests.put("your xively API url", json=json) resp.close()

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.