# from unify_api.modules.elec_charge.dao.elec_charge_dao import \
#     query_charge_aggs_points
# from unify_api.utils.time_format import start_end_date
#
#
# async def fog_data(point_list):
#     """雾炮数据"""
#     # 1. 当日用电量
#     today_start, today_end, m_start, m_end = start_end_date()
#     kwh_es_res = await query_charge_aggs_points(today_start, today_end,
#                                                 point_list)
#     kwh_es_res = {i["key"]: i for i in kwh_es_res if kwh_es_res}
#     # 2. 运行时间和状态, 根据功率判定
#     p_es_res = await query_point_15min_index_aggs_pid(today_start, today_end,
#                                                       point_list)
#     p_es_res = {i["key"]: i for i in kwh_es_res if kwh_es_res}
#
#     for point in point_list:
#
def pm2_5_trans_grade(value):
    if 35 >= value >= 0:
        return "优"
    elif 75 >= value > 35:
        return "良"
    elif 115 >= value > 75:
        return "轻度污染"
    elif 150 >= value > 115:
        return "中度污染"
    elif 250 >= value > 150:
        return "重度污染"
    elif value > 250:
        return "严重污染"


def pm10_trans_grade(value):
    if 50 >= value >= 0:
        return "优"
    elif 150 >= value > 50:
        return "良"
    elif 250 >= value > 150:
        return "轻度污染"
    elif 350 >= value > 250:
        return "中度污染"
    elif 420 >= value > 350:
        return "重度污染"
    elif value > 420:
        return "严重污染"


def tsp_trans_grade(value):
    if 300 >= value >= 0:
        return "合格"
    elif value > 300:
        return "不合格"
