name: Gas leak detector
# products:
#   - id: UNKNOWN
#     manufacturer: Digma
#     model: DiSense G1
entities:
  - entity: sensor
    name: Self-check result
    class: enum
    category: diagnostic
    dps:
      - id: 1
        type: string
        optional: true
        name: sensor
        mapping:
          - dps_val: null
            value: unchecked
          - dps_val: checking
            value: checking
          - dps_val: check_success
            value: success
          - dps_val: check_failure
            value: failure
          - dps_val: others
            value: other
  - entity: binary_sensor
    class: gas
    dps:
      - id: 2
        type: string
        name: sensor
        mapping:
          - dps_val: alarm
            value: true
          - value: false
  - entity: number
    name: Alarm duration
    class: duration
    category: config
    dps:
      - id: 3
        type: integer
        name: value
        unit: s
        range:
          min: 0
          max: 60
  - entity: sensor
    class: volatile_organic_compounds_parts
    category: diagnostic
    dps:
      - id: 5
        type: integer
        name: sensor
        unit: ppm
        class: measurement
        mapping:
          - scale: 10
  - entity: button
    name: Self check
    category: config
    dps:
      - id: 9
        type: boolean
        optional: true
        name: button
  - entity: binary_sensor
    class: cold
    category: diagnostic
    dps:
      - id: 10
        type: boolean
        name: sensor
  - entity: button
    name: Mute
    category: config
    dps:
      - id: 14
        type: boolean
        optional: true
        name: button
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 45
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
      - id: 45
        type: bitfield
        name: fault_code
      - id: 45
        type: bitfield
        name: description
        mapping:
          - dps_val: 0
            value: ok
          - dps_val: 1
            value: fault
          - dps_val: 2
            value: serious_fault
          - dps_val: 4
            value: sensor_fault
          - dps_val: 8
            value: probe_fault
          - dps_val: 16
            value: power_fault
