
// 判断是否是plug
export const isPlug = (dpCodes: Record<string, string>) => {
  return !!dpCodes.switch_1
}

// 玻璃灯：支持颜色和色温灯同时调节
export const isGlassRGBWLamp = (dpCodes: Record<string, string>) => {
  return !!(
    !dpCodes.mix_rgbcw &&
    !dpCodes.temp_value &&
    dpCodes.colour_data &&
    dpCodes.bright_value
  )
}
// 双灯泡吸顶灯：支持颜色和色温灯同时调节
export const isMixRGBWLamp = (dpCodes: Record<string, string>) => {
  return !!(
    dpCodes.mix_rgbcw &&
    dpCodes.colour_data &&
    dpCodes.temp_value &&
    dpCodes.bright_value
  )
}

// 支持调节：颜色/色温+亮度
export const isRGBWLamp = (dpCodes: Record<string, string>) => {
  return !!(
    !dpCodes.mix_rgbcw &&
    dpCodes.colour_data &&
    dpCodes.temp_value &&
    dpCodes.bright_value
  )
}

// 支持调节：颜色/单一色温亮度
export const isRGBLamp = (dpCodes: Record<string, string>) => {
  return !!(
    !dpCodes.mix_rgbcw &&
    !dpCodes.temp_value &&
    dpCodes.colour_data &&
    dpCodes.bright_value
  )
}

// 支持调节：颜色
export const isOnlyRGBLamp = (dpCodes: Record<string, string>) => {
  return !!(
    !dpCodes.mix_rgbcw &&
    !dpCodes.temp_value &&
    !dpCodes.bright_value &&
    dpCodes.colour_data
  )
}

// 支持调节：色温+亮度
export const isTWLamp = (dpCodes: Record<string, string>) => {
  return !!(
    !dpCodes.mix_rgbcw &&
    !dpCodes.colour_data &&
    dpCodes.temp_value &&
    dpCodes.bright_value
  )
}

// 支持调节: 色温+ 温度
export const isFanLamp = (dpCodes: Record<string, string>) => {
  return !!(
    !dpCodes.mix_rgbcw &&
    !dpCodes.colour_data &&
    dpCodes.temp_value &&
    dpCodes.bright_value && 
    dpCodes.fan_speed
  )
}

// 支持调节：单一色温亮度
export const isDIMLamp = (dpCodes: Record<string, string>) => {
  return !!(
    !dpCodes.mix_rgbcw &&
    !dpCodes.colour_data &&
    !dpCodes.temp_value &&
    dpCodes.bright_value
  )
}

// GARDOT灯具
export const isGARDOT = (dpCodes: Record<string, string>) => {
  return !!(
    dpCodes.switch_led &&
    dpCodes.work_mode &&
    dpCodes.colour_data &&
    dpCodes.scene_data &&
    dpCodes.countdown &&
    dpCodes.control_data
  )
}

export const isSupportColor = (dpCodes: Record<string, string>) => {
  return !!(dpCodes.colour_data)
}

export const isSupportTemperature = (dpCodes: Record<string, string>) => {
  return !!(dpCodes.temp_value)
}

export const isSupportBrightness = (dpCodes: Record<string, string>) => {
  return !!(dpCodes.bright_value)
}