Просмотр исходного кода

Add Support for Smart 3D Oscillating DC Fan (Kogan) (#4459)

* Add Smart 3D Oscillating DC Fan configuration

Added configuration for Smart 3D Oscillating DC Fan including entities for fan control, modes, oscillation, and timer settings.

* Update smart 3D oscillating fan configuration

Hide the Timer entity in the configuration and ensure proper formatting of the switch name.

* Fix formatting of hidden property in fan YAML

fixed linting

* Refactor fan configuration for clarity and consistency

Updated names and values for various fan settings to improve consistency and clarity.

* Update entity translation keys

* Rename device from 'Smart 3D Oscillating DC Fan' to 'Fan' generic name

* Update fan configuration and mapping settings

- add default mapping for oscillate to catch the other presets
- rename mute to sound and invert, for consistency with other devices

PR #4459

---------

Co-authored-by: Jason Rumney <make-all@users.noreply.github.com>
angus-thompson 16 часов назад
Родитель
Сommit
8f104d9fb5
1 измененных файлов с 112 добавлено и 0 удалено
  1. 112 0
      custom_components/tuya_local/devices/smart_3d_oscillating_dc_fan.yaml

+ 112 - 0
custom_components/tuya_local/devices/smart_3d_oscillating_dc_fan.yaml

@@ -0,0 +1,112 @@
+name: Fan
+products:
+  - id: udqi9qir8xu7fxmb
+    manufacturer: Kogan
+    model: Smart 3D Oscillating DC Fan
+entities:
+  - entity: fan
+    translation_key: fan_with_presets
+    dps:
+      - id: 1
+        type: boolean
+        name: switch
+      - id: 3
+        type: integer
+        name: speed
+        range:
+          min: 1
+          max: 10
+      - id: 2
+        type: string
+        name: oscillate
+        mapping:
+          - dps_val: "3Dmode"
+            value: true
+          - dps_val: normal
+            value: false
+          - value: false
+            hidden: true
+      - id: 2
+        type: string
+        name: preset_mode
+        mapping:
+          - dps_val: normal
+            value: normal
+          - dps_val: nature
+            value: nature
+          - dps_val: sleep
+            value: sleep
+          - dps_val: auto
+            value: auto
+          - dps_val: "3Dmode"
+            value: 3D Mode
+
+  - entity: select
+    name: Vertical oscillation
+    icon: "mdi:arrow-up-down-bold-outline"
+    category: config
+    dps:
+      - id: 6
+        type: string
+        name: option
+        mapping:
+          - dps_val: Run
+            value: "On"
+          - dps_val: Stop
+            value: "Off"
+
+  - entity: select
+    name: Horizontal swing
+    icon: "mdi:arrow-left-right-bold-outline"
+    category: config
+    dps:
+      - id: 7
+        type: string
+        name: option
+        mapping:
+          - dps_val: Cancel
+            value: "Off"
+          - dps_val: "0"
+            value: "0°"
+          - dps_val: "60"
+            value: "60°"
+          - dps_val: "90"
+            value: "90°"
+          - dps_val: "120"
+            value: "120°"
+          - dps_val: "150"
+            value: "150°"
+
+  - entity: select
+    translation_key: timer
+    category: config
+    dps:
+      - id: 22
+        type: string
+        name: option
+        mapping:
+          - dps_val: cancel
+            value: cancel
+          - dps_val: "1h"
+            value: "1h"
+          - dps_val: "2h"
+            value: "2h"
+          - dps_val: "4h"
+            value: "4h"
+          - dps_val: "8h"
+            value: "8h"
+          - dps_val: "12h"
+            value: "12h"
+
+  - entity: switch
+    translation_key: sound
+    category: config
+    dps:
+      - id: 101
+        type: boolean
+        name: switch
+        mapping:
+          - dps_val: false
+            value: true
+          - dps_val: true
+            value: false