name: Curtain
products:
  - id: wraaecjqfiirj8go
    name: Loonas curtain motor
  - id: f6jujmx0is5td50x
    name: Zemismart BCM500DS-TYW
primary_entity:
  entity: cover
  class: curtain
  dps:
    - id: 1
      name: control
      type: string
      optional: true
      mapping:
        - dps_val: open
          value: open
        - dps_val: close
          value: close
        - dps_val: stop
          value: stop
    - id: 2
      name: position
      type: integer
      range:
        min: 0
        max: 100
      mapping:
        - invert: true
    - id: 3
      name: current_position
      type: integer
      optional: true
      range:
        min: 0
        max: 100
      mapping:
        - invert: true
secondary_entities:
  - entity: switch
    name: Reverse
    category: config
    icon: "mdi:arrow-u-down-left"
    dps:
      - id: 5
        type: string
        name: switch
        mapping:
          - dps_val: back
            value: true
          - dps_val: forward
            value: false
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 12
        type: boolean
        name: sensor
        optional: true
        persist: false
        mapping:
          - dps_val: 0
            value: false
          - dps_val: null
            value: false
          - value: true
      - id: 12
        name: fault_code
        type: bitfield
        optional: true
