name: Kettle
products:
  - id: rsygyyeiyarl4urt
    manufacturer: Setti+
    model: KT950W
    name: Czajnik
# - id: UNKNOWN
#   manufacturer: Kogan
#   model: KASMTSSKTLB
entities:
  - entity: water_heater
    translation_key: kettle
    dps:
      - id: 1
        type: boolean
        name: operation_mode
        mapping:
          - dps_val: false
            value: "off"
          - dps_val: true
            value: electric
      - id: 2
        type: integer
        name: current_temperature
        mapping:
          - constraint: temperature_unit
            conditions:
              - dps_val: f
                value_redirect: current_temp_f
      - id: 3
        type: integer
        name: current_temp_f
        hidden: true
      - id: 8
        type: integer
        name: temperature
        range:
          min: 0
          max: 100
        mapping:
          - constraint: temperature_unit
            conditions:
              - dps_val: f
                value_redirect: temp_set_f
                range:
                  min: 32
                  max: 212
      - id: 9
        type: integer
        name: temp_set_f
        range:
          min: 32
          max: 212
        hidden: true
      - id: 12
        type: string
        name: temperature_unit
        mapping:
          - dps_val: c
            value: C
          - dps_val: f
            value: F
  - entity: select
    translation_key: kettle_mode
    dps:
      - id: 16
        type: string
        name: option
        mapping:
          - dps_val: setting_quick
            value: quick_heat
          - dps_val: boiling_quick
            value: quick_boil
          - dps_val: temp_setting
            value: heat
          - dps_val: temp_boiling
            value: boil
  - entity: select
    name: Quick set temperature C
    icon: "mdi:water-thermometer-outline"
    category: config
    dps:
      - id: 4
        type: string
        name: option
        mapping:
          - constraint: unit
            conditions:
              - dps_val: c
                mapping:
                  - dps_val: '40'
                    value: '40'
                  - dps_val: '85'
                    value: '85'
              - dps_val: f
                invalid: true
      - id: 12
        type: string
        name: unit
  - entity: select
    name: Quick set temperature F
    icon: "mdi:water-thermometer-outline"
    category: config
    dps:
      - id: 5
        type: string
        name: option
        mapping:
          - constraint: unit
            conditions:
              - dps_val: f
                mapping:
                  - dps_val: '104'
                    value: '104'
                  - dps_val: '185'
                    value: '185'
              - dps_val: c
                invalid: true
      - id: 12
        type: string
        name: unit
  - entity: select
    name: Quick boil temperature C
    icon: "mdi:water-thermometer"
    category: config
    dps:
      - id: 6
        type: string
        name: option
        mapping:
          - constraint: unit
            conditions:
              - dps_val: c
                mapping:
                  - dps_val: '40'
                    value: '40'
                  - dps_val: '85'
                    value: '85'
                  - dps_val: '100'
                    value: '100'
              - dps_val: f
                invalid: true
      - id: 12
        type: string
        name: unit
  - entity: select
    name: Quick boil temperature F
    icon: "mdi:water-thermometer"
    category: config
    dps:
      - id: 7
        type: string
        name: option
        mapping:
          - constraint: unit
            conditions:
              - dps_val: f
                mapping:
                  - dps_val: '104'
                    value: '104'
                  - dps_val: '185'
                    value: '185'
                  - dps_val: '212'
                    value: '212'
              - dps_val: c
                invalid: true
      - id: 12
        type: string
        name: unit
  - entity: number
    name: Boil temperature
    category: config
    class: temperature
    icon: "mdi:coolant-temperature"
    dps:
      - id: 10
        type: integer
        name: value
        range:
          min: 0
          max: 100
        mapping:
          - constraint: unit
            conditions:
              - dps_val: f
                value_redirect: temp_boiling_f
                range:
                  min: 32
                  max: 212
      - id: 11
        type: integer
        name: temp_boiling_f
        hidden: true
        range:
          min: 32
          max: 212
      - id: 12
        type: string
        name: unit
        mapping:
          - dps_val: c
            value: C
          - dps_val: f
            value: F
  - entity: select
    translation_key: temperature_unit
    category: config
    dps:
      - id: 12
        type: string
        name: option
        mapping:
          - dps_val: c
            value: celsius
          - dps_val: f
            value: fahrenheit
  - entity: switch
    name: Keep warm
    icon: "mdi:kettle-outline"
    dps:
      - id: 13
        type: boolean
        name: switch
  - entity: number
    name: Keep warm time
    category: config
    class: duration
    icon: "mdi:timer"
    dps:
      - id: 14
        type: integer
        name: value
        unit: min
        range:
          min: 0
          max: 360
  - entity: sensor
    translation_key: status
    class: enum
    category: diagnostic
    dps:
      - id: 15
        type: string
        name: sensor
        mapping:
          - dps_val: standby
            value: standby
          - dps_val: heating
            value: heating
          - dps_val: cooling
            value: cooling
          - dps_val: warm
            value: keeping_warm
          - dps_val: heating_temp
            value: no_water
          - dps_val: boiling_temp
            value: boiling
          - dps_val: reserve_1
            value: reserved_1
          - dps_val: reserve_2
            value: reserved_2
          - dps_val: reserve_3
            value: reserved_3
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 19
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
      - id: 19
        type: bitfield
        name: fault_code
  - entity: sensor
    translation_key: time_remaining
    class: duration
    category: diagnostic
    hidden: unavailable
    dps:
      - id: 18
        type: integer
        optional: true
        name: sensor
        unit: min
      - id: 18
        type: integer
        optional: true
        name: available
        mapping:
          - dps_val: null
            value: false
          - value: true
