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

Summary: fix (fanco_ecosilentdeluxe): revise based on new info

Issue #399 that added this device was missing some detail, so there
was a lot of guesswork. PR #4012 for a different model with the same
product id has some minor differences which are probably correct for
the original due to the same product id:
- preset_mode was missing: this was identified in #399, but overlooked.
- color temperature is normal
- timer goes to 9h. Original was guessed as up to 4h based on online manual
- dp 24 is actually a fault code, not the time remaining as guessed.
Jason Rumney 2 месяцев назад
Родитель
Сommit
616be3c988

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -1125,3 +1125,4 @@ Further device support has been made with the assistance of users. Please consid
 - [johndparker](https://github.com/johndparker) for assisting with support for HHC AM24 curtain motor.
 - [emcyaman](https://github.com/emcyaman) for contributing support for Zemismart SPM02-D2TW energy meter.
 - [gec75](https://github.com/gec75) for contributing support for Afyeev 11kW 3x15A EV charger, which was merged with the existing Afyeev 16A config.
+- [brendanlees](https://github.com/brendanlees) for contributing support for Fanco Infinity, which was merged with existing Fanco Eco Silent.

+ 30 - 7
custom_components/tuya_local/devices/fanco_ecosilentdeluxe.yaml

@@ -6,10 +6,19 @@ products:
     model_id: MZ-DCFAN
 entities:
   - entity: fan
+    translation_only_key: fan_with_presets
     dps:
       - id: 1
         name: switch
         type: boolean
+      - id: 2
+        name: preset_mode
+        type: string
+        mapping:
+          - dps_val: normal
+            value: normal
+          - dps_val: nature
+            value: nature
       - id: 3
         name: speed
         type: integer
@@ -37,8 +46,7 @@ entities:
           min: 0
           max: 1000
         mapping:
-          - invert: true
-            target_range:
+          - target_range:
               min: 3000
               max: 5000
   - entity: select
@@ -59,12 +67,27 @@ entities:
             value: "3h"
           - dps_val: "4"
             value: "4h"
-  - entity: sensor
-    translation_key: time_remaining
+          - dps_val: "5"
+            value: "5h"
+          - dps_val: "6"
+            value: "6h"
+          - dps_val: "7"
+            value: "7h"
+          - dps_val: "8"
+            value: "8h"
+          - dps_val: "9"
+            value: "9h"
+  - entity: binary_sensor
+    class: problem
     category: diagnostic
-    class: duration
     dps:
       - id: 24
-        type: integer
+        type: bitfield
         name: sensor
-        unit: s
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 24
+        type: bitfield
+        name: fault_code