package com.qiuguo.iot.base.enums;

/*
* 设备类型枚举
* 作者：吴林
* */
// 0 果Box 1智能插座 2智能大灯 3智能窗帘驱动 4智能窗户关闭 5智能台灯
// 6智能桌子 7智能椅子 8智能风扇 9智能空调（遥控器） 10智能冰箱 11智能洗碗机
// 12智能电热水器 13温度传感器 14空气质量传感器 15光线传感器 16雨量传感器
//17闭门器
// 1000秋果box android配置App 1001秋果Box iOS配置App
public enum DeviceTypeEnum {
    GUO_BOX(0, "果box", "BOX"),
    ELECTRIC_SOCKET(1, "涂鸦设备", "tuya"),
    BIG_LIGHT(2, "智能大灯", "BIL"),
    CURTAIN_DRIVE(3, "智能窗帘驱动", "CUR"),
    WINDOW_DRIVE(4, "智能窗户关闭", "WIN"),
    DESK_LAMP(5, "智能台灯", "DEL"),
    DESK(6, "智能桌子", "DES"),
    SEAT(7, "智能椅子", "SEA"),
    ELECTRIC_FAN(8, "智能风扇", "FAN"),
    AIR_CONDITIONING_CONTROL(9, "智能空调（遥控器）", "CON"),
    ICEBOX(10, "智能冰箱", "ICE"),
    DISHWASHER(11, "智能洗碗机", "DIS"),
    ELECTRIC_WATER(12, "智能电热水器", "EWT"),
    TEMPERATURE_SENSOR(13, "温度传感器", "TEP"),
    AIR_QUALITY_SENSOR(14, "空气质量传感器", "AIR"),
    LIGHT_SENSOR(15, "光线传感器", "LSE"),
    RAIN_SENSOR(16, "雨量传感器", "RAI"),
    DOOR_CLOSER(17, "闭门器", "DCL"),
    BOX_ANDROID_SET_APP(1000, "秋果Android设置App", "AAP"),
    BOX_IOS_SET_APP(1001, "秋果iOS设置App", "AIP"),
    ;
     DeviceTypeEnum(Integer c, String n, String s){
        code = c;
        name = n;
        sn = s;
    }
    private Integer code;
    private String name;

    private String sn;//序列号中间字母QGBOX
    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public String getSn() {
        return sn;
    }

    public static DeviceTypeEnum getEnumWithCode(Integer c){
        for (DeviceTypeEnum e:values()
        ) {
            if(e.getCode().compareTo(c) == 0){
                return e;
            }
        }
        return null;
    }
    public static DeviceTypeEnum getEnumWithName(String name){
        for (DeviceTypeEnum e:values()
        ) {
            if(e.getName().equals(name)){
                return e;
            }
        }
        return null;
    }
}
