name: Air purifier
products:
  - id: 7v1gn9wmbqvtcqkc
    name: Tesla Air S300
primary_entity:
  entity: fan
  dps:
    - id: 1
      type: boolean
      name: switch
    - id: 4
      type: string
      name: speed
      mapping:
        - dps_val: "1"
          value: 14
        - dps_val: "2"
          value: 28
        - dps_val: "3"
          value: 42
        - dps_val: "4"
          value: 57
        - dps_val: "5"
          value: 71
        - dps_val: "6"
          value: 85
        - dps_val: "7"
          value: 100
secondary_entities:
  - entity: sensor
    class: pm25
    category: diagnostic
    dps:
      - id: 2
        type: integer
        name: sensor
        unit: ugm3
        class: measurement
  - entity: sensor
    name: Filter
    category: diagnostic
    dps:
      - id: 5
        type: integer
        name: sensor
        unit: "%"
  - entity: switch
    translation_key: ionizer
    category: config
    dps:
      - id: 6
        type: boolean
        name: switch
  - entity: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 7
        type: boolean
        name: lock
        optional: true
        mapping:
          - dps_val: null
            value: false
            hidden: true
  - entity: switch
    translation_key: uv_sterilization
    category: config
    dps:
      - id: 9
        type: boolean
        name: switch
  - entity: button
    name: Filter reset
    class: restart
    category: config
    dps:
      - id: 11
        type: boolean
        optional: true
        name: button
  - entity: select
    translation_key: timer
    category: config
    dps:
      - id: 18
        type: string
        name: option
        mapping:
          - dps_val: cancel
            value: cancel
          - dps_val: "1h"
            value: "1h"
          - dps_val: "2h"
            value: "2h"
          - dps_val: "3h"
            value: "3h"
          - dps_val: "4h"
            value: "4h"
          - dps_val: "5h"
            value: "5h"
          - dps_val: "6h"
            value: "6h"
          - dps_val: "7h"
            value: "7h"
          - dps_val: "8h"
            value: "8h"
          - dps_val: "9h"
            value: "9h"
          - dps_val: "10h"
            value: "10h"
          - dps_val: "11h"
            value: "11h"
          - dps_val: "12h"
            value: "12h"
  - entity: sensor
    name: Air quality
    class: enum
    category: diagnostic
    dps:
      - id: 21
        type: string
        name: sensor
        mapping:
          - dps_val: great
            value: Great
          - dps_val: mild
            value: Mild
          - dps_val: good
            value: Good
          - dps_val: medium
            value: Medium
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 22
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
      - id: 22
        type: bitfield
        name: fault_code
  - entity: switch
    name: Mute
    icon: "mdi:volume-mute"
    category: config
    dps:
      - id: 104
        type: boolean
        name: switch
  - entity: select
    name: Light
    icon: "mdi:lightbulb"
    dps:
      - id: 105
        type: string
        name: option
        mapping:
          - dps_val: "off"
            value: "Off"
          - dps_val: orange
            value: Orange
          - dps_val: green
            value: Green
          - dps_val: blue
            value: Blue
          - dps_val: yellow
            value: Yellow
