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

Kogan aircons and fans: Changes from review

- Arlec 6 speed fan: revert these undocumented changes that conflict
  with the original new device request
- Kogan KASBKSTFANSA: merge with KASBLFAN1CSA
- Kogan KABLFAN1CSA: naming changes, use translated presets
  rename to kogan_bladeless_fan.yaml, as it now covers two models.
- Kogan air conditioners: add temperature selector, naming changes

Product ids on these are suspicious - seems like the product codes
from packaging, not what the tuya protocol reports.

PR #1480
Jason Rumney 2 лет назад
Родитель
Сommit
2bd30e54ec

+ 10 - 10
custom_components/tuya_local/devices/arlec_6speed_fan.yaml

@@ -18,18 +18,18 @@ primary_entity:
           value: nature
         - dps_val: sleep
           value: sleep
-     #   - dps_val: fresh
-     #     value: fresh
-     #   - dps_val: smart
-     #     value: smart
-     #   - dps_val: strong
-     #     value: strong
-     #   - dps_val: closed
-     #     value: "off"
+        - dps_val: fresh
+          value: fresh
+        - dps_val: smart
+          value: smart
+        - dps_val: strong
+          value: strong
+        - dps_val: closed
+          value: "off"
         - dps_val: ordinary
           value: normal
-     #   - dps_val: null
-     #     value: "off"
+        - dps_val: null
+          value: "off"
     - id: 3
       name: speed
       type: string

+ 18 - 6
custom_components/tuya_local/devices/kogan_kasbkstfansa_fan.yaml → custom_components/tuya_local/devices/kogan_bladeless_fan.yaml

@@ -1,8 +1,12 @@
-name: Kogan Smart Bladeless Turbo Fan (Silver)
+name: Bladeless fan
 products:
+  - id: kablfan1csa
+    name: Kogan KABLFAN1CSA
   - id: kasblstfansa
+    name: Kogan KASBKSTFANSA
 primary_entity:
   entity: fan
+  translation_key: fan_with_presets
   dps:
     - id: 1
       type: boolean
@@ -45,11 +49,11 @@ primary_entity:
         - dps_val: close
           value: "off"
         - dps_val: sleep
-          value: Sleep
+          value: sleep
         - dps_val: fresh
-          value: Nature
+          value: nature
         - dps_val: heavy
-          value: Boost
+          value: strong
     - id: 8
       type: boolean
       name: oscillate
@@ -62,9 +66,17 @@ secondary_entities:
     icon: "mdi:volume-high"
     category: config
     dps:
-      - id: 101
+      - id: 102
         type: boolean
+        optional: true
         name: switch
+        mapping:
+          - dps_val: null
+            value_redirect: alternate
+      - id: 101
+        type: boolean
+        optional: true
+        name: alternate
   - entity: binary_sensor
     name: Fault
     class: problem
@@ -110,6 +122,6 @@ secondary_entities:
     dps:
       - id: 12
         type: string
+        optional: true
         name: sensor
         unit: mins
-            

+ 0 - 109
custom_components/tuya_local/devices/kogan_kablfan1csa_fan.yaml

@@ -1,109 +0,0 @@
-name: Kogan Smarterhome Bladeless Purifier Fan
-products:
-  - id: kablfan1csa
-primary_entity:
-  entity: fan
-  dps:
-    - id: 1
-      type: boolean
-      name: switch
-    - id: 2
-      type: string
-      name: speed
-      mapping:
-        - dps_val: "1"
-          value: 11
-          step: 11
-        - dps_val: "2"
-          value: 22
-          step: 11
-        - dps_val: "3"
-          value: 33
-          step: 11
-        - dps_val: "4"
-          value: 44
-          step: 11
-        - dps_val: "5"
-          value: 55
-          step: 11
-        - dps_val: "6"
-          value: 66
-          step: 11
-        - dps_val: "7"
-          value: 77
-          step: 11
-        - dps_val: "8"
-          value: 88
-          step: 11
-        - dps_val: "9"
-          value: 100
-          step: 12
-    - id: 3
-      name: preset_mode
-      type: string
-      mapping:
-        - dps_val: close
-          value: "off"
-        - dps_val: sleep
-          value: Sleep
-        - dps_val: fresh
-          value: Nature
-        - dps_val: heavy
-          value: Boost
-    - id: 8
-      type: boolean
-      name: oscillate
-    - id: 13
-      name: fault_code
-      type: bitfield
-secondary_entities:
-  - entity: switch
-    name: Sound
-    icon: "mdi:volume-high"
-    category: config
-    dps:
-      - id: 102
-        type: boolean
-        name: switch
-  - entity: binary_sensor
-    name: Fault
-    class: problem
-    category: diagnostic
-    dps:
-      - id: 13
-        type: bitfield
-        name: sensor
-        mapping:
-          - dps_val: 0
-            value: false
-          - value: true
-  - entity: select
-    name: Timer
-    icon: "mdi:timer"
-    category: config
-    dps:
-      - id: 11
-        type: string
-        name: option
-        mapping:
-          - dps_val: "0"
-            value: "Off"
-          - dps_val: "1"
-            value: "1 hour"
-          - dps_val: "2"
-            value: "2 hours"
-          - dps_val: "3"
-            value: "3 hours"
-          - dps_val: "4"
-            value: "4 hours"
-          - dps_val: "5"
-            value: "5 hours"
-          - dps_val: "6"
-            value: "6 hours"
-          - dps_val: "7"
-            value: "7 hours"
-          - dps_val: "8"
-            value: "8 hours"
-            
-            
-            

+ 23 - 30
custom_components/tuya_local/devices/kogan_kawfpac12ya_airconditioner.yaml

@@ -1,7 +1,7 @@
-name: Kogan Y12 Airconditioner
+name: Air conditioner
 products:
   - id: kawfpac12ya
-    name: Kogan Smart PAC_Y12
+    name: Kogan PAC_Y12
 primary_entity:
   entity: climate
   dps:
@@ -24,20 +24,17 @@ primary_entity:
             - dps_val: DRY
               icon: "mdi:water"
               value: dry
-         #   - dps_val: Heat
-         #     icon: "mdi:heat-wave"
-         #     value: heat
     - id: 2
       name: temperature
       type: integer
       mapping:
         - constraint: temperature_unit
           conditions:
-            - dps_val: "C"
+            - dps_val: C
               range:
                 min: 16
                 max: 32
-            - dps_val: "F"
+            - dps_val: F
               range:
                 min: 60
                 max: 90
@@ -48,33 +45,15 @@ primary_entity:
       name: mode
       type: string
       hidden: true
-
-
-          # conditions:
-          #   - dps_val: COOL
-          #     icon: "mdi:snowflake"
-          #     value: cold
-          #   - dps_val: FAN
-          #     icon: "mdi:fan"
-          #     value: wind
-          #   - dps_val: DRY
-          #     icon: "mdi:water"
-          #     value: wet
-          #   - dps_val: HEAT
-          #     icon: "mdi:fire"
-          #     value: hot
-
-
-
     - id: 5
       name: fan_mode
-      type: integer
+      type: string
       mapping:
-        - dps_val: 1
+        - dps_val: "1"
           value: low
-        - dps_val: 2
+        - dps_val: "2"
           value: medium
-        - dps_val: 3
+        - dps_val: "3"
           value: high
     - id: 19
       name: temperature_unit
@@ -112,4 +91,18 @@ primary_entity:
       type: boolean
     - id: 110
       name: unknown_110
-      type: integer
+      type: integer
+secondary_entities:
+  - entity: select
+    name: Temperature unit
+    icon: "mdi:temperature_celsius"
+    category: config
+    dps:
+      - id: 19
+        type: string
+        name: option
+        mapping:
+          - dps_val: C
+            value: Celsius
+          - dps_val: F
+            value: Fahrenheit

+ 23 - 27
custom_components/tuya_local/devices/kogan_kawfpac16pya_airconditioner.yaml

@@ -1,7 +1,7 @@
-name: Kogan PY16 Airconditioner
+name: Heat pump
 products:
   - id: kawfpac16pya
-    name: Kogan Smart PAC_PY16
+    name: Kogan PAC_PY16
 primary_entity:
   entity: climate
   dps:
@@ -33,11 +33,11 @@ primary_entity:
       mapping:
         - constraint: temperature_unit
           conditions:
-            - dps_val: "C"
+            - dps_val: C
               range:
                 min: 16
                 max: 32
-            - dps_val: "F"
+            - dps_val: F
               range:
                 min: 60
                 max: 90
@@ -48,33 +48,15 @@ primary_entity:
       name: mode
       type: string
       hidden: true
-
-
-          # conditions:
-          #   - dps_val: COOL
-          #     icon: "mdi:snowflake"
-          #     value: cold
-          #   - dps_val: FAN
-          #     icon: "mdi:fan"
-          #     value: wind
-          #   - dps_val: DRY
-          #     icon: "mdi:water"
-          #     value: wet
-          #   - dps_val: HEAT
-          #     icon: "mdi:fire"
-          #     value: hot
-
-
-
     - id: 5
       name: fan_mode
-      type: integer
+      type: string
       mapping:
-        - dps_val: 1
+        - dps_val: "1"
           value: low
-        - dps_val: 2
+        - dps_val: "2"
           value: medium
-        - dps_val: 3
+        - dps_val: "3"
           value: high
     - id: 19
       name: temperature_unit
@@ -112,4 +94,18 @@ primary_entity:
       type: boolean
     - id: 110
       name: unknown_110
-      type: integer
+      type: integer
+secondary_entities:
+  - entity: select
+    name: Temperature unit
+    icon: "mdi:temperature_celsius"
+    category: config
+    dps:
+      - id: 19
+        type: string
+        name: option
+        mapping:
+          - dps_val: C
+            value: Celsius
+          - dps_val: F
+            value: Fahrenheit