Browse Source

Fisher summer air conditioner: add compatible Daitsu model

A few extra dps (hopefully not conflicting with any previously undiscovered
ones)

- Move non-useful sensor to attribute
- Move swing_mode into climate entity
- quote numeric strings to ensure correct type matching

Issue #1933
Jason Rumney 1 year ago
parent
commit
07b4fce29b

+ 67 - 56
custom_components/tuya_local/devices/fisher_summer_air_conditioner.yaml

@@ -1,7 +1,9 @@
 name: Air conditioner
 name: Air conditioner
 products:
 products:
   - id: bf8705744de2dd5ab4ogqj
   - id: bf8705744de2dd5ab4ogqj
-    name: Fisher Summer Air Conditioner
+    name: Fisher Summer
+  - id: u9jjsaluqe1trtxv
+    name: Daitsu DS-9KTP
 primary_entity:
 primary_entity:
   entity: climate
   entity: climate
   translation_only_key: aircon_extra
   translation_only_key: aircon_extra
@@ -97,9 +99,42 @@ primary_entity:
       #   21. temperature scale switching, 1 is Fahrenheit, 0 is Celsius
       #   21. temperature scale switching, 1 is Fahrenheit, 0 is Celsius
       #   22. soft wind
       #   22. soft wind
       #   23. left and right wide-angle air supply
       #   23. left and right wide-angle air supply
+    - id: 115
+      type: integer
+      name: total_n
+      optional: true
+    - id: 116
+      type: integer
+      name: total_p
+      optional: true
     - id: 123
     - id: 123
       name: options
       name: options
       type: string
       type: string
+    - id: 128
+      name: style
+      type: string
+      optional: true
+      mapping:
+        - dps_val: "0"
+          value: wall
+        - dps_val: "1"
+          value: floor
+    - id: 133
+      name: swing_mode
+      type: string
+      mapping:
+        - dps_val: "0"
+          value: "off"
+        - dps_val: "1"
+          value: horizontal
+        - dps_val: "2"
+          value: vertical
+        - dps_val: "3"
+          value: both
+    - id: 134
+      name: work_time
+      type: string
+      optional: true
 secondary_entities:
 secondary_entities:
   - entity: binary_sensor
   - entity: binary_sensor
     class: problem
     class: problem
@@ -145,14 +180,14 @@ secondary_entities:
         name: option
         name: option
         type: string
         type: string
         mapping:
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: None
             value: None
             default: true
             default: true
-          - dps_val: 1
+          - dps_val: "1"
             value: Upper and lower
             value: Upper and lower
-          - dps_val: 2
+          - dps_val: "2"
             value: Upper
             value: Upper
-          - dps_val: 3
+          - dps_val: "3"
             value: Lower
             value: Lower
   - entity: select
   - entity: select
     name: Horizontal Sweep
     name: Horizontal Sweep
@@ -162,22 +197,22 @@ secondary_entities:
         name: option
         name: option
         type: string
         type: string
         mapping:
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: "Off"
             value: "Off"
             default: true
             default: true
-          - dps_val: 1
+          - dps_val: "1"
             value: Left and Right
             value: Left and Right
-          - dps_val: 2
+          - dps_val: "2"
             value: Left
             value: Left
-          - dps_val: 3
+          - dps_val: "3"
             value: Middle
             value: Middle
-          - dps_val: 4
+          - dps_val: "4"
             value: Right
             value: Right
-          - dps_val: 5
+          - dps_val: "5"
             value: Partial Left
             value: Partial Left
-          - dps_val: 6
+          - dps_val: "6"
             value: Partial Right
             value: Partial Right
-          - dps_val: 7
+          - dps_val: "7"
             value: Wide Angle
             value: Wide Angle
   - entity: select
   - entity: select
     name: Energy Saving
     name: Energy Saving
@@ -187,14 +222,14 @@ secondary_entities:
         name: option
         name: option
         type: string
         type: string
         mapping:
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: None
             value: None
             default: true
             default: true
-          - dps_val: 1
+          - dps_val: "1"
             value: Default Power Saving
             value: Default Power Saving
-          - dps_val: 2
+          - dps_val: "2"
             value: Quota Power Saving
             value: Quota Power Saving
-          - dps_val: 3
+          - dps_val: "3"
             value: Fixed Temperature Power Saving
             value: Fixed Temperature Power Saving
         optional: true
         optional: true
   - entity: select
   - entity: select
@@ -230,18 +265,18 @@ secondary_entities:
         name: option
         name: option
         type: string
         type: string
         mapping:
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: Freeze Current Position
             value: Freeze Current Position
             default: true
             default: true
-          - dps_val: 1
+          - dps_val: "1"
             value: Top
             value: Top
-          - dps_val: 2
+          - dps_val: "2"
             value: Slightly Up
             value: Slightly Up
-          - dps_val: 3
+          - dps_val: "3"
             value: Middle
             value: Middle
-          - dps_val: 4
+          - dps_val: "4"
             value: Slightly Down
             value: Slightly Down
-          - dps_val: 5
+          - dps_val: "5"
             value: Down
             value: Down
   - entity: select
   - entity: select
     name: Set Horizontal Direction  # Tuya JSON phrasing: Freeze Horizontal
     name: Set Horizontal Direction  # Tuya JSON phrasing: Freeze Horizontal
@@ -251,24 +286,24 @@ secondary_entities:
         name: option
         name: option
         type: string
         type: string
         mapping:
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: Freeze Current Position
             value: Freeze Current Position
             default: true
             default: true
-          - dps_val: 1
+          - dps_val: "1"
             value: Left
             value: Left
-          - dps_val: 2
+          - dps_val: "2"
             value: Slightly Left
             value: Slightly Left
-          - dps_val: 3
+          - dps_val: "3"
             value: Middle
             value: Middle
-          - dps_val: 4
+          - dps_val: "4"
             value: Slightly Right
             value: Slightly Right
-          - dps_val: 5
+          - dps_val: "5"
             value: Right
             value: Right
-          - dps_val: 6
+          - dps_val: "6"
             value: Wide Angle Left
             value: Wide Angle Left
-          - dps_val: 7
+          - dps_val: "7"
             value: Wide Angle Right
             value: Wide Angle Right
-          - dps_val: 8
+          - dps_val: "8"
             value: Wide Angle
             value: Wide Angle
   - entity: select
   - entity: select
     name: Power
     name: Power
@@ -325,30 +360,6 @@ secondary_entities:
           - dps_val: false
           - dps_val: false
             value: Hot wind
             value: Hot wind
         optional: true
         optional: true
-  - entity: select
-    name: Swing Direction
-    category: config
-    dps:
-      - id: 133
-        name: option
-        type: string
-        mapping:
-          - dps_val: 0
-            value: None
-            default: true
-          - dps_val: 1
-            value: Horizontal Only
-          - dps_val: 2
-            value: Vertical Only
-          - dps_val: 3
-            value: Horizontal and Vertical
-  - entity: sensor
-    name: Work Time
-    dps:
-      - id: 134
-        name: sensor
-        type: string
-        optional: true
   - entity: sensor
   - entity: sensor
     name: Running Time
     name: Running Time
     class: duration
     class: duration