// 模拟 WatchConstant 和 L 工具类
const WatchConstant = {
    nameList: ['watch1', 'watch2', 'watch3'] // 假设的名称列表
};


// 电量对应图标
function kwh2Icon({ kwh }) {
    if (kwh <= 0) {
        icon = "./../../img/dl0.png";
    } else if (kwh > 0 && kwh <= 1) {
        icon = "./../../img/dl1.png";
    } else if (kwh > 1 && kwh <= 4) {
        icon = "./../../img/dl2.png";
    } else if (kwh > 4 && kwh <= 7) {
        icon = "./../../img/dl3.png";
    } else if (kwh > 7 && kwh <= 9) {
        icon = "./../../img/dl4.png";
    } else if (kwh === 10) {
        icon = "./../../img/dl5.png";
    }
    return icon;
}

// 电量文案
function kwh2Text({ kwh }) {
    L.w(`电量状态====${kwh}`);
    let k;
    if (kwh < 0) {
        k = 0;
    } else if (kwh > 9) {
        k = 9;
        return kwh === 0xFF ? "" : "充电中";
    } else {
        k = kwh;
    }
    return `${k + 1}0%`;
}