content: package com.zyc.zcontrol.deviceItem.DeviceClass;
  
  import android.preference.PreferenceFragment;
  
  import androidx.annotation.DrawableRes;
  import androidx.fragment.app.Fragment;
  
  
  import com.zyc.zcontrol.R;
  import com.zyc.zcontrol.deviceItem.a1.A1LinkActivity;
  import com.zyc.zcontrol.deviceItem.clock.ClockLinkActivity;
  import com.zyc.zcontrol.deviceItem.dc1.DC1LinkActivity;
  import com.zyc.zcontrol.deviceItem.m1.M1LinkActivity;
  import com.zyc.zcontrol.deviceItem.mops.MOPSLinkActivity;
  import com.zyc.zcontrol.deviceItem.s7.S7LinkActivity;
  import com.zyc.zcontrol.deviceItem.tc1.TC1LinkActivity;
  
  
  public class Device {
  
  
      //region 静态变量
      public final static int TYPE_UNKNOWN = -1;
      public final static int TYPE_BUTTON_MATE = 0;
      public final static int TYPE_TC1 = 1;
      public final static int TYPE_DC1 = 2;
      public final static int TYPE_A1 = 3;
      public final static int TYPE_M1 = 4;
      public final static int TYPE_S7 = 5;
      public final static int TYPE_CLOCK = 6;
      public final static int TYPE_MOPS = 7;
      public final static int TYPE_RGBW = 8;
      public final static int TYPE_CLOCK_MATRIX = 9;
      public final static int TYPE_KEY51 = 10;
      public final static int TYPE_C1 = 11;
      public final static int TYPE_UARTTOMQTT = 12;
      public final static int TYPE_Z863KEY = 13;
      public final static int TYPE_COUNT = 14;
  
      //设备名称
      public final static String[] TypeName = new String[]{
              "按键伴侣",//0
              "zTC1智能排插",//1
              "zDC1智能排插",   //2
              "zA1空气净化器", //3
              "zM1空气检测仪", //4
              "zS7/zS7pe体重秤",   //5
              "zClock时钟",    //6
              "zMOPS插座",   //7
              "zRGBW灯",   //8
              "zClock点阵时钟",   //9
              "zKey51按键",   //10
              "zC1门窗传感器",   //11
              "z485toMqtt",   //12
              "z86_3Key墙壁开关",   //13
      };
      //设备链接地址
      public final static String[] TypeUri = new String[]{
              "https://github.com/a2633063/SmartControl_ButtonMate_ESP8266",//0
              "https://github.com/a2633063/zTC1",//1
              "https://github.com/a2633063/zDC1",   //2
              "https://github.com/a2633063/zA1", //3
              "https://github.com/a2633063/zM1", //4
              "https://github.com/a2633063/zS7",   //5
              "https://github.com/a2633063/zClock",    //6
              "https://github.com/a2633063/zMOPS",   //7
              "https://github.com/a2633063/zRGBW",   //8
              "https://github.com/a2633063/zClock_Matrix",   //9
              "https://github.com/a2633063/zKey51",   //10
              "https://github.com/a2633063/zC1",   //11
              "https://github.com/a2633063/z485toMqtt",   //12
              "https://github.com/a2633063/z86_3key",   //13
      };
      //设备图标
      public final static @DrawableRes
      int Type_Icon[] = {
              R.drawable.device_icon_diy,//0
              R.drawable.device_icon_ztc1,//1
              R.drawable.device_icon_zdc1,//2
              R.drawable.device_icon_za1,//3
              R.drawable.device_icon_zm1,//4
              R.drawable.device_icon_zs7,//5
              R.drawable.device_icon_zclock,//6
              R.drawable.device_icon_zmops,//7
              R.drawable.device_icon_zrgbw,//8
              R.drawable.device_icon_zclock_matrix,//9
              R.drawable.device_icon_diy,//10
              R.drawable.device_icon_diy,//11
              R.drawable.device_icon_diy,//12
              R.drawable.device_icon_diy,//13
      };
  
      //设备对应配对页面
      public final static Class LinkActivity[] =
              {
                      null,//0
                      TC1LinkActivity.class,//1
                      DC1LinkActivity.class,//2
                      A1LinkActivity.class,//3
                      M1LinkActivity.class,//4
                      S7LinkActivity.class,//5
                      ClockLinkActivity.class,//6
                      MOPSLinkActivity.class,//7
                      null,//8
                      null,//9
                      null,//10
                      null,//11
                      null,//12
                      null,//13
              };
  //endregion
  
      protected int type = TYPE_UNKNOWN;
      private String name;
      private String mac;
      private String ip;
      private String group;
      private boolean online;
  //    private String version=null;
  //    private String ssid=null;
  
      //region gitter and setter
      public int getType() {
          return type;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public String getMac() {
          return mac;
      }
  
      public String getIp() {
          return ip;
      }
  
      public void setIp(String ip) {
          this.ip = ip;
      }
  
      public String getGroup() {
          return group;
      }
  
      public void setGroup(String group) {
          this.group = group;
      }
  
  
      public boolean isOnline() {
          return online;
      }
  
      public void setOnline(boolean online) {
          this.online = online;
      }
  
  //    public String getVersion() {
  //        return version;
  //    }
  //
  //    public void setVersion(String version) {
  //        this.version = version;
  //    }
  //
  //    public String getSsid() {
  //        return ssid;
  //    }
  //
  //    public void setSsid(String ssid) {
  //        this.ssid = ssid;
  //    }
  
  //endregion
  
  
      public Device(int type, String name, String mac) {
          this.name = name;
          this.mac = mac;
          this.type = type;
      }
  
      public String getTypeName() {
          return TypeName[type];
      }
  
      public int getIcon() {
          return Type_Icon[type];
      }
  
      //region 子类必须重构函数
      public String getDocUri() {
          return TypeUri[type];
      }
  
  
      public String[] getRecvMqttTopic() {
          return null;
      }
  
      public String getSendMqttTopic() {
          return null;
      }
  
      Fragment fragment;
  
      public Fragment getFragment() {
          return fragment;
      }
  
      public PreferenceFragment getSettingFragment() {
          return null;
      }
      //endregion
  
  }
  