name: Aroma diffuser
products:
  - id: GQxEe5orh45cMgA6
    manufacturer: Delixing
    model: KCL-M1803A-M
entities:
  - entity: fan
    translation_only_key: aroma_diffuser
    dps:
      - id: 2
        type: string
        name: switch
        mapping:
          - dps_val: "1"
            value: false
          - dps_val: "2"
            value: true
          - value: true
      - id: 2
        type: string
        name: preset_mode
        mapping:
          - dps_val: "1"
            value: "none"
          - dps_val: "2"
            value: continuous
          - dps_val: "3"
            value: intermittent
          - dps_val: "4"
            value: timer
      - id: 101
        type: string
        optional: true
        name: speed
        mapping:
          - dps_val: "1"
            value: 50
          - dps_val: "2"
            value: 100
  - entity: sensor
    translation_key: time_remaining
    category: diagnostic
    dps:
      - id: 4
        type: integer
        name: sensor
        unit: min
  - entity: light
    dps:
      - id: 5
        type: boolean
        optional: true
        name: switch
        mapping:
          - dps_val: null
            value_redirect: mode_switch
      - id: 6
        type: string
        name: mode_switch
        mapping:
          - dps_val: close
            value: false
          - dps_val: colorful
            value: true
          - dps_val: white
            value: true
            hidden: true
          - dps_val: color
            value: true
            hidden: true
      - id: 6
        name: color_mode
        type: string
        mapping:
          - dps_val: white
            value: white
          - dps_val: color
            value: hs
          - dps_val: colorful
            value: Colorful
          - dps_val: close
            value: "Light off"
      - id: 7
        name: brightness
        type: integer
        range:
          min: 0
          max: 255
      - id: 8
        name: rgbhsv
        type: hex
        format:
          - name: r
            bytes: 1
          - name: g
            bytes: 1
          - name: b
            bytes: 1
          - name: h
            bytes: 2
            range:
              min: 0
              max: 360
          - name: s
            bytes: 1
            range:
              min: 0
              max: 100
          - name: v
            bytes: 1
            range:
              min: 0
              max: 100
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 9
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
      - id: 9
        type: bitfield
        name: fault_code
  - entity: number
    translation_key: timer
    class: duration
    category: config
    dps:
      - id: 102
        type: integer
        optional: true
        name: value
        unit: min
        range:
          min: 0
          max: 360
