Jelajahi Sumber

Added support for ilife a12 pro vacuum (#4754)

* Added support for ilife a12 pro vacuum

* Update ilife_a12_pro_vacuum.yaml - lint fixes

* Update ilife_a12_pro_vacuum.yaml - refixed lint

last commit somehow went wrong

* Debrand device name, standardise quoting, use common naming

- removed branding from top-level name, as other devices may match the config
- standardise double quotes like other configs
- use same names or translation_keys as other vacuums for common entities

PR #4754

---------

Co-authored-by: Jason Rumney <make-all@users.noreply.github.com>
Jonno Molenaar 3 hari lalu
induk
melakukan
b2113d96be
1 mengubah file dengan 461 tambahan dan 0 penghapusan
  1. 461 0
      custom_components/tuya_local/devices/ilife_a12_pro_vacuum.yaml

+ 461 - 0
custom_components/tuya_local/devices/ilife_a12_pro_vacuum.yaml

@@ -0,0 +1,461 @@
+name: Robot vacuum
+products:
+  - id: 9uib7wur9qbt7oov
+    manufacturer: ILIFE
+    model: A12 Pro
+entities:
+  - entity: vacuum
+    dps:
+      - id: 1
+        type: boolean
+        name: activate
+        optional: true
+        mapping:
+          - dps_val: false
+            constraint: pause
+            conditions:
+              - dps_val: true
+                value: false
+              - dps_val: false
+                value: false
+                hidden: true
+              - dps_val: null
+                value: false
+                hidden: true
+          - dps_val: true
+            constraint: pause
+            conditions:
+              - dps_val: false
+                value: true
+              - dps_val: true
+                value: true
+                hidden: true
+              - dps_val: null
+                value: true
+                hidden: true
+          - dps_val: null
+            value: false
+            hidden: true
+      - id: 2
+        type: boolean
+        optional: true
+        name: pause
+        hidden: true
+      - id: 4
+        type: string
+        name: command
+        mapping:
+          - dps_val: smart
+            value: smart
+          - dps_val: chargego
+            value: return_to_base
+          - dps_val: zone
+            value: zone
+          - dps_val: pose
+            value: clean_spot
+          - dps_val: part
+            value: partial
+      - id: 5
+        type: string
+        name: status
+        mapping:
+          - dps_val: standby
+            value: standby
+          - dps_val: smart
+            value: smart
+          - dps_val: zone_clean
+            value: zone
+          - dps_val: part_clean
+            value: partial
+          - dps_val: cleaning
+            value: cleaning
+          - dps_val: paused
+            value: paused
+          - dps_val: goto_pos
+            value: seeking_spot
+          - dps_val: pos_arrived
+            value: located_spot
+          - dps_val: pos_unarrive
+            value: left_spot
+          - dps_val: goto_charge
+            value: returning
+          - dps_val: charging
+            value: charging
+          - dps_val: charge_done
+            value: charged
+          - dps_val: base_charging
+            value: charging
+          - dps_val: adapter_charging
+            value: charging
+          - dps_val: base_sleeping
+            value: docked
+          - dps_val: adapter_sleeping
+            value: sleep
+          - dps_val: continuation_charging
+            value: charging
+          - dps_val: sleep
+            value: sleep
+      - id: 9
+        type: string
+        name: fan_speed
+        mapping:
+          - dps_val: closed
+            value: "Off"
+          - dps_val: gentle
+            value: Low
+          - dps_val: normal
+            value: Medium
+          - dps_val: strong
+            value: High
+      - id: 11
+        type: boolean
+        name: locate
+        optional: true
+      - id: 12
+        type: string
+        name: direction_control
+        mapping:
+          - dps_val: backward
+            value: backward
+          - dps_val: turn_left
+            value: left
+          - dps_val: turn_right
+            value: right
+          - dps_val: stop
+            value: stop
+      - id: 14
+        type: string
+        optional: true
+        name: path_data
+      - id: 15
+        type: string
+        optional: true
+        name: command_trans
+      - id: 28
+        type: bitfield
+        name: error
+        hidden: true
+      - id: 35
+        type: string
+        optional: true
+        name: voice_data
+  - entity: switch
+    name: Charge
+    icon: "mdi:battery-charging"
+    category: config
+    dps:
+      - id: 3
+        type: boolean
+        optional: true
+        name: switch
+  - entity: sensor
+    name: Clean time
+    icon: "mdi:progress-clock"
+    class: duration
+    category: diagnostic
+    dps:
+      - id: 6
+        type: integer
+        name: sensor
+        unit: min
+  - entity: sensor
+    name: Clean area
+    class: area
+    category: diagnostic
+    dps:
+      - id: 7
+        type: integer
+        name: sensor
+        unit: m2
+  - entity: sensor
+    class: battery
+    dps:
+      - id: 8
+        type: integer
+        name: sensor
+        unit: "%"
+        class: measurement
+  - entity: select
+    translation_key: mopping
+    category: config
+    dps:
+      - id: 10
+        type: string
+        name: option
+        mapping:
+          - dps_val: closed
+            value: "off"
+          - dps_val: low
+            value: low
+          - dps_val: middle
+            value: medium
+          - dps_val: high
+            value: high
+  - entity: select
+    name: Fetch request
+    icon: "mdi:message-question"
+    category: config
+    hidden: true
+    dps:
+      - id: 16
+        type: string
+        optional: true
+        name: option
+        mapping:
+          - dps_val: get_map
+            value: Map
+          - dps_val: get_path
+            value: Path
+          - dps_val: get_both
+            value: Both
+  - entity: sensor
+    name: Edge brush life
+    category: diagnostic
+    class: duration
+    dps:
+      - id: 17
+        type: integer
+        name: sensor
+        unit: min
+  - entity: sensor
+    name: Rolling brush life
+    category: diagnostic
+    class: duration
+    dps:
+      - id: 19
+        type: integer
+        name: sensor
+        unit: min
+  - entity: sensor
+    translation_key: filter_life
+    category: diagnostic
+    class: duration
+    dps:
+      - id: 21
+        type: integer
+        name: sensor
+        unit: min
+  - entity: number
+    name: Dust collection frequency
+    category: config
+    icon: "mdi:weather-dust"
+    dps:
+      - id: 37
+        type: integer
+        name: value
+        optional: true
+        range:
+          min: 0
+          max: 99999
+  - entity: number
+    translation_key: volume
+    category: config
+    dps:
+      - id: 26
+        type: integer
+        name: value
+        optional: true
+        unit: "%"
+        range:
+          min: 0
+          max: 10
+        mapping:
+          - scale: 0.1
+  - entity: sensor
+    name: Total cleaning area
+    class: area
+    category: diagnostic
+    dps:
+      - id: 29
+        type: integer
+        name: sensor
+        unit: m2
+  - entity: sensor
+    name: Total cleaning count
+    icon: "mdi:counter"
+    category: diagnostic
+    dps:
+      - id: 30
+        type: integer
+        name: sensor
+  - entity: sensor
+    name: Total cleaning time
+    class: duration
+    icon: "mdi:history"
+    category: diagnostic
+    dps:
+      - id: 31
+        type: integer
+        name: sensor
+        unit: min
+  - entity: button
+    name: Map reset
+    icon: "mdi:map-marker-remove"
+    category: config
+    dps:
+      - id: 13
+        type: boolean
+        name: button
+        optional: true
+  - entity: button
+    name: Edge brush reset
+    class: restart
+    category: config
+    dps:
+      - id: 18
+        type: boolean
+        name: button
+        optional: true
+  - entity: button
+    name: Roll brush reset
+    class: restart
+    category: config
+    dps:
+      - id: 20
+        type: boolean
+        name: button
+        optional: true
+  - entity: button
+    translation_key: filter_reset
+    category: config
+    dps:
+      - id: 22
+        type: boolean
+        name: button
+        optional: true
+  - entity: switch
+    translation_key: do_not_disturb
+    category: config
+    dps:
+      - id: 25
+        type: boolean
+        name: switch
+  - entity: switch
+    name: Intermittent cleaning
+    icon: "mdi:clock-star-four-points"
+    category: config
+    dps:
+      - id: 27
+        type: boolean
+        name: switch
+  - entity: switch
+    name: Auto carpet boost
+    icon: "mdi:car-turbocharger"
+    category: config
+    dps:
+      - id: 45
+        type: boolean
+        optional: true
+        name: switch
+  - entity: switch
+    name: Dust collection enable
+    icon: "mdi:weather-dust"
+    category: config
+    dps:
+      - id: 38
+        type: boolean
+        optional: true
+        name: switch
+  - entity: switch
+    name: Y-shaped mop
+    icon: "mdi:alpha-y"
+    category: config
+    dps:
+      - id: 149
+        type: boolean
+        optional: true
+        name: switch
+  - entity: select
+    name: Cleaning efficiency
+    icon: "mdi:robot-vacuum"
+    category: config
+    dps:
+      - id: 155
+        type: string
+        optional: true
+        name: option
+        mapping:
+          - dps_val: careful
+            value: Careful
+          - dps_val: normal
+            value: Normal
+          - dps_val: fast
+            value: Fast
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 28
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 28
+        type: bitfield
+        name: fault_code
+      - id: 28
+        type: bitfield
+        name: description
+        mapping:
+          - dps_val: 0
+            value: OK
+          - dps_val: 1
+            value: bumper_fault
+          - dps_val: 2
+            value: obs_fault
+          - dps_val: 4
+            value: wall_fault
+          - dps_val: 8
+            value: cliff_fault
+          - dps_val: 16
+            value: land_fault
+          - dps_val: 32
+            value: nosewheel_fault
+          - dps_val: 64
+            value: l_brush_fault
+          - dps_val: 128
+            value: r_brush_fault
+          - dps_val: 256
+            value: brush_fault
+          - dps_val: 512
+            value: l_wheel_fault
+          - dps_val: 1024
+            value: r_wheel_fault
+          - dps_val: 2048
+            value: m_brush_fault
+          - dps_val: 4096
+            value: fan_fault
+          - dps_val: 8192
+            value: waterpump_fault
+          - dps_val: 16384
+            value: air_pump_fault
+          - dps_val: 32768
+            value: garbage_fault
+          - dps_val: 65536
+            value: water_box_fault
+          - dps_val: 131072
+            value: filter_fault
+          - dps_val: 262144
+            value: battery_fault
+          - dps_val: 524288
+            value: gyro_fault
+          - dps_val: 1048576
+            value: radar_fault
+          - dps_val: 2097152
+            value: camera_fault
+          - dps_val: 4194304
+            value: stuck_fault
+          - dps_val: 8388608
+            value: flow_fault
+          - dps_val: 16777216
+            value: other_fault
+          - dps_val: 33554432
+            value: low_light_fault
+          - dps_val: 67108864
+            value: water1_fault
+          - dps_val: 134217728
+            value: water2_fault
+          - dps_val: 268435456
+            value: explore_fault