name: Smartplug
entities:
  - entity: switch
    dps:
      - id: 1
        type: boolean
        name: switch
      - id: 41
        type: string
        name: cycle_timer
        optional: true
      - id: 42
        type: string
        name: random_timer
        optional: true
      - id: 43
        type: string
        name: inching
  - entity: number
    class: duration
    translation_key: timer
    category: config
    dps:
      - id: 9
        type: integer
        name: value
        unit: min
        range:
          min: 0
          max: 86400
        mapping:
          - scale: 60
            step: 60
  - entity: sensor
    name: Energy
    category: diagnostic
    hidden: true
    dps:
      - id: 17
        type: integer
        name: sensor
        unit: Wh
        optional: true
        class: measurement
  - entity: sensor
    class: current
    category: diagnostic
    dps:
      - id: 18
        type: integer
        name: sensor
        unit: mA
        class: measurement
  - entity: sensor
    class: power
    category: diagnostic
    dps:
      - id: 19
        type: integer
        name: sensor
        unit: W
        class: measurement
        mapping:
          - scale: 10
  - entity: sensor
    class: voltage
    category: diagnostic
    dps:
      - id: 20
        type: integer
        name: sensor
        unit: V
        class: measurement
        mapping:
          - scale: 10
  - entity: select
    translation_key: initial_state
    category: config
    dps:
      - id: 38
        type: string
        name: option
        mapping:
          - dps_val: power_off
            value: "off"
          - dps_val: power_on
            value: "on"
          - dps_val: last
            value: memory
  - entity: select
    name: Backlight
    icon: "mdi:television-ambient-light"
    category: config
    dps:
      - id: 39
        type: string
        name: option
        mapping:
          - dps_val: relay
            value: State
          - dps_val: pos
            value: Position
          - dps_val: none
            value: "Off"
  - entity: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 40
        type: boolean
        name: lock
