EzData is an IoT cloud data storage service provided by M5Stack, allowing different devices to insert or retrieve data into a storage queue using a unique token, enabling data sharing across devices.
from m5stack import *
from m5ui import *
from uiflow import *
from flow import ezdata
import wifiCfg
i = None
wifiCfg.autoConnect(lcdShow=False)
while True:
ezdata.setData('6ijRMmiFRdO2tVfFIbNpy6PN1sRvFmsy', 'my_topic', 'Hello EzData')
print(ezdata.getData('6ijRMmiFRdO2tVfFIbNpy6PN1sRvFmsy', 'my_topic'))
for i in range(11):
ezdata.addToList('6ijRMmiFRdO2tVfFIbNpy6PN1sRvFmsy', 'my_list', i)
print(ezdata.getData('6ijRMmiFRdO2tVfFIbNpy6PN1sRvFmsy', 'my_list', 0, 50))
ezdata.removeData('6ijRMmiFRdO2tVfFIbNpy6PN1sRvFmsy', 'my_topic')
print(ezdata.getCurrentISODateTime())
wait_ms(2)
ezdata.setData('6ijRMmiFRdO2tVfFIbNpy6PN1sRvFmsy', 'my_topic', 'Hello EzData')
print(ezdata.getData('6ijRMmiFRdO2tVfFIbNpy6PN1sRvFmsy', 'my_topic'))
ezdata.addToList('6ijRMmiFRdO2tVfFIbNpy6PN1sRvFmsy', 'my_list', i)
print(ezdata.getData('6ijRMmiFRdO2tVfFIbNpy6PN1sRvFmsy', 'my_list', 0, 50))
ezdata.removeData('6ijRMmiFRdO2tVfFIbNpy6PN1sRvFmsy', 'my_topic')
print(ezdata.getCurrentISODateTime())
ezdata.setDataAsync(ezdata_set_NdmNNcb, ezdata_set_fail_NdmNNcb, '6ijRMmiFRdO2tVfFIbNpy6PN1sRvFmsy', 'my_topic', 'Hello EzData')
ezdata.addToListAsync(ezdata_set_iQCwDcb, ezdata_set_fail_iQCwDcb, '6ijRMmiFRdO2tVfFIbNpy6PN1sRvFmsy', 'my_list', i)
ezdata.getDataAsync(ezdata_get_iRBYXcb, ezdata_get_fail_iRBYXcb, '6ijRMmiFRdO2tVfFIbNpy6PN1sRvFmsy', 'my_topic')
ezdata.getDataAsync(ezdata_get_rfWJMcb, ezdata_get_fail_rfWJMcb, '6ijRMmiFRdO2tVfFIbNpy6PN1sRvFmsy', 'my_list', 0, 50)
ezdata.removeDataAsync(ezdata_remove_KcMAbcb, ezdata_remove_fail_KcMAbcb, '6ijRMmiFRdO2tVfFIbNpy6PN1sRvFmsy', '')
ezdata.getCurrentISODateTimeAsync(ezdata_get_ESdHGcb, ezdata_get_fail_ESdHGcb)