package com.quyunshuo.module.home.enums

import com.quyunshuo.androidbaseframemvvm.common.util.UiUtil
import com.quyunshuo.module.home.R

//还需要增加宽度和高度的自定义。因为每个logo都不一样。
enum class DevStateEnum(val state: Int, val code: String, val deveStateName: String) {
    UNKNOWN(-1, "0000", UiUtil.getStringRes(R.string.base_unknown_state)),
    STOP(0, "0002", UiUtil.getStringRes(R.string.base_close_dev)),
    STARTUP(1, "01", UiUtil.getStringRes(R.string.base_startup)),
    STARTDOWN(2, "02", UiUtil.getStringRes(R.string.base_shutdown)),
    STARTSUCCESS(3, "0B", UiUtil.getStringRes(R.string.base_startup));//开机完成

    companion object {
        fun getEnumByValue(code: String): DevStateEnum? {
            for (anEnum in DevStateEnum.values()) {
                if (code.startsWith(anEnum.code)) {
                    return anEnum
                }
            }
            return null
        }

    }
}