name: Air purifier

products:
  - id: jzo3p4ltk8kue6yg
    manufacturer: MORENTO
    model: MR5866

entities:
  - entity: fan
    translation_only_key: fan_with_presets
    dps:
      - id: 1
        name: switch
        type: boolean

      - id: 3
        name: preset_mode
        type: string
        mapping:
          - dps_val: auto
            value: auto
          - dps_val: sleep
            value: sleep
          - dps_val: "1F"
            value: low
          - dps_val: "2F"
            value: medium
          - dps_val: "3F"
            value: high

  - entity: sensor
    class: pm25
    dps:
      - id: 2
        name: sensor
        type: integer
        class: measurement
        unit: ugm3

  - entity: sensor
    translation_key: filter_life
    category: diagnostic
    dps:
      - id: 5
        name: sensor
        type: integer
        unit: "%"

  - entity: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 7
        name: lock
        type: boolean

  - entity: light
    translation_key: backlight
    category: config
    dps:
      - id: 8
        name: switch
        type: boolean

  - entity: button
    translation_key: filter_reset
    category: config
    class: restart
    dps:
      - id: 11
        name: button
        optional: true
        type: boolean

  - entity: select
    translation_key: timer
    category: config
    dps:
      - id: 18
        name: option
        type: string
        mapping:
          - dps_val: cancel
            value: cancel
          - dps_val: 2h
            value: 2h
          - dps_val: 5h
            value: 5h
          - dps_val: 8h
            value: 8h

  - entity: sensor
    translation_key: time_remaining
    class: duration
    category: diagnostic
    dps:
      - id: 19
        type: integer
        optional: true
        name: sensor
        unit: min

  - entity: sensor
    translation_key: air_quality
    class: enum
    dps:
      - id: 21
        name: sensor
        type: string
        mapping:
          - dps_val: good
            value: good
          - dps_val: moderate
            value: moderate
          - dps_val: unhealthy
            value: severe
