Commit e49a7c87 authored by wang.wenrong's avatar wang.wenrong

识电U

parent a048a3c8
......@@ -9,6 +9,7 @@ from pot_libs.logger import log
from unify_api import constants
from unify_api.modules.common.service.td_engine_service import \
get_td_engine_data
from unify_api.utils.taos_new import parse_td_columns
METERDATA_CURRENT_KEY = "meterdata_current"
METERDATA_CURRENT_HR_KEY = "meterdata_hr_current"
......@@ -237,8 +238,7 @@ async def elec_current_data_new15(mtids, cid):
"""
is_succ, results = await get_td_engine_data(url, sql)
if is_succ:
head = [re.findall(r'last_row\((.*)\)', i)[0] if "(" in i else i
for i in results["head"]]
head = parse_td_columns(results)
for res in results["data"]:
data = dict(zip(head, res))
if data["mtid"] in mtids:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment