chore(boards): 调整micropython下TinyWebDB

This commit is contained in:
王立帮
2025-09-28 18:11:27 +08:00
parent 81d819228a
commit c66edf6dd9

View File

@@ -355,9 +355,9 @@ class MQTTClient:
self._tiny_web_db.set_url(url)
return self._tiny_web_db.count()
def tiny_web_db_search(self, url, count):
def tiny_web_db_search(self, url, no=1, count=1, tag='', dtype='both'):
self._tiny_web_db.set_url(url)
return self._tiny_web_db.search(count)
return self._tiny_web_db.search(no, count, tag, dtype)
def tiny_web_db_delete(self, url, key):
self._tiny_web_db.set_url(url)
@@ -390,9 +390,10 @@ class TinyWebDB:
raise RuntimeError(result["message"])
return int(result["count"])
def search(self, count):
def search(self, no=1, count=1, tag='', dtype='both'):
no = str(no)
count = str(count)
result = self._request("search", "count={}".format(count))
result = self._request("search", "no={}&count={}&tag={}&type={}".format(no, count, tag, dtype))
if result["status"] == "error":
raise RuntimeError(result["message"])
return result["data"]