name: Light and fan
products:
  - id: u5ovvhurbvynvspv
    name: Ledkia fan and light controller
primary_entity:
  entity: fan
  dps:
    - id: 60
      type: boolean
      name: switch
    - id: 62
      type: integer
      name: speed
      optional: true
      range:
        min: 1
        max: 6
    - id: 63
      type: string
      name: direction
secondary_entities:
  - entity: light
    dps:
      - id: 20
        type: boolean
        name: switch
      - id: 21
        type: string
        name: color_mode
        mapping:
          - dps_val: white
            value: color_temp
      - id: 22
        type: integer
        name: brightness
        range:
          min: 10
          max: 1000
      - id: 23
        type: integer
        name: color_temp
        range:
          min: 0
          max: 1000
        optional: true
        mapping:
          - step: 500
            target_range:
              min: 2700
              max: 6500
      - id: 59
        type: string
        name: light_type
        optional: true
  - entity: number
    name: Minimum brightness
    icon: "mdi:brightness-6"
    category: config
    dps:
      - id: 58
        type: integer
        name: value
        unit: "%"
        optional: true
        range:
          min: 10
          max: 1000
        mapping:
          - scale: 10
  - entity: number
    name: Fan timer
    translation_key: timer
    category: config
    dps:
      - id: 64
        type: integer
        name: value
        range:
          min: 0
          max: 540
        unit: min
