name: Ceiling fan
products:
  - id: oyvkkiagwcstatfy
    model: NP-DVL-01
entities:
  - entity: light
    name: Main light
    dps:
      - id: 20
        type: boolean
        name: switch
      - id: 21
        type: string
        optional: true
        name: color_mode
        mapping:
          - dps_val: white
            value: color_temp
          - dps_val: colour
            value: hs
          - dps_val: scene
            value: Scene
          - dps_val: music
            value: Music
      - id: 22
        type: integer
        name: brightness
        range:
          min: 10
          max: 1000
      - id: 23
        type: integer
        name: color_temp
        range:
          min: 0
          max: 1000
        mapping:
          - target_range:
              min: 2700
              max: 6500
      - id: 24
        name: rgbhsv
        optional: true
        type: hex
        format:
          - name: h
            bytes: 2
            range:
              min: 0
              max: 360
          - name: s
            bytes: 2
            range:
              min: 0
              max: 1000
          - name: v
            bytes: 2
            range:
              min: 0
              max: 1000
  - entity: text
    translation_key: scene
    category: config
    hidden: true
    dps:
      - id: 25
        type: hex
        optional: true
        name: value
  - entity: time
    translation_key: timer
    category: config
    dps:
      - id: 26
        type: integer
        optional: true
        name: second
        range:
          min: 0
          max: 86399
  - entity: text
    name: Light control
    category: config
    hidden: true
    dps:
      - id: 28
        type: string
        optional: true
        name: value
  - entity: text
    translation_key: scene
    name: Mixed scene
    category: config
    hidden: true
    dps:
      - id: 36
        type: base64
        optional: true
        name: value
  - entity: light
    name: White
    dps:
      - id: 20
        type: boolean
        name: available
      - id: 22
        type: integer
        name: brightness
        range:
          min: 10
          max: 1000
      - id: 23
        type: integer
        name: color_temp
        range:
          min: 0
          max: 1000
        mapping:
          - target_range:
              min: 2700
              max: 6500
      - id: 103
        type: boolean
        name: switch
  - entity: light
    name: Color
    dps:
      - id: 20
        type: boolean
        name: available
      - id: 102
        type: boolean
        name: switch
      - id: 24
        name: rgbhsv
        type: hex
        optional: true
        format:
          - name: h
            bytes: 2
            range:
              min: 0
              max: 360
          - name: s
            bytes: 2
            range:
              min: 0
              max: 1000
          - name: v
            bytes: 2
            range:
              min: 0
              max: 1000
  - entity: text
    name: Color
    category: config
    icon: "mdi:palette"
    hidden: true
    dps:
      - id: 51
        type: base64
        optional: true
        name: value

  - entity: fan
    translation_only_key: fan_with_presets
    dps:
      - id: 60
        type: boolean
        name: switch
      - id: 61
        type: string
        name: preset_mode
        mapping:
          - dps_val: nature
            value: nature
          - dps_val: fresh
            value: fresh
      - id: 62
        type: integer
        optional: true
        name: speed
        range:
          min: 1
          max: 6
      - id: 63
        type: string
        optional: true
        name: direction
      - id: 101
        type: boolean
        name: oscillate
  - entity: number
    name: Fan timer
    translation_key: timer
    category: config
    icon: "mdi:fan-clock"
    dps:
      - id: 64
        type: integer
        optional: true
        name: value
        unit: min
        range:
          min: 0
          max: 540
