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

Ecostrad Accent iQ: update to modern conventions

This was quite an old config, and had some issues:

- timer was implemented as numeric, but was actually using strings, so
should be select (may be causing compatibility issues).

- temperature_unit was present, but not settable (Byecold info says it is rw)

- Top level name was product specific. Now that another brand and model is
confirmed to match, this has been fixed.

Product ids are not available for either the Ecostrad or the Byecold model,
so products can only be added as comments for now.

Issue #2551
Jason Rumney 1 год назад
Родитель
Сommit
a9b967a79c
1 измененных файлов с 48 добавлено и 8 удалено
  1. 48 8
      custom_components/tuya_local/devices/ecostrad_accentiq_heater.yaml

+ 48 - 8
custom_components/tuya_local/devices/ecostrad_accentiq_heater.yaml

@@ -1,4 +1,9 @@
-name: Ecostrad Accent iQ heater
+name: Heater
+# products:
+#   - id: UNKNOWN
+#     name: Ecostrad Accent iQ
+#   - id: UNKNOWN
+#     name: Byecold B0DF1PKDFP
 primary_entity:
   entity: climate
   translation_only_key: heater
@@ -41,14 +46,49 @@ primary_entity:
         - dps_val: false
           value: F
 secondary_entities:
-  - entity: number
+  - entity: select
     translation_key: timer
     category: config
     dps:
       - id: 10
-        type: integer
-        name: value
-        unit: h
-        range:
-          min: 0
-          max: 12
+        type: string
+        name: option
+        mapping:
+          - dps_val: "0"
+            value: cancel
+          - dps_val: "1"
+            value: "1h"
+          - dps_val: "2"
+            value: "2h"
+          - dps_val: "3"
+            value: "3h"
+          - dps_val: "4"
+            value: "4h"
+          - 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"
+          - dps_val: "10"
+            value: "10h"
+          - dps_val: "11"
+            value: "11h"
+          - dps_val: "12"
+            value: "12h"
+  - entity: select
+    translation_key: temperature_unit
+    category: config
+    dps:
+      - id: 101
+        type: string
+        name: option
+        mapping:
+          - dps_val: true
+            value: celsius
+          - dps_val: false
+            value: fahrenheit