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

Thermoval TVT40: merge into identical Saswell C16 config

Even product ids match
Jason Rumney 1 год назад
Родитель
Сommit
bb1764301c

+ 41 - 17
custom_components/tuya_local/devices/saswell_c16_thermostat.yaml

@@ -1,6 +1,8 @@
-name: C16 WiFi thermostat
+name: Thermostat
+legacy_type: thermoval_tvt40_thermostat
 products:
   - id: jIRwsT5yLPJO41Po
+    name: Thermoval TVT 40 / Saswell C16
 primary_entity:
   entity: climate
   translation_only_key: thermostat
@@ -21,21 +23,19 @@ primary_entity:
       mapping:
         - dps_val: Smart
           value: program
-          icon: "mdi:home-thermometer"
         - dps_val: Anti_frozen
           value: away
-          icon: "mdi:snowflake-melt"
         - dps_val: Manual
           value: manual
-          icon: "mdi:cursor-pointer"
-    - id: 4
-      name: unknown_4
-      type: integer
     - id: 5
       name: current_temperature
       type: integer
       mapping:
         - scale: 10
+          constraint: sensor_select
+          conditions:
+            - dps_val: "0"
+              value_redirect: floor_temperature
     - id: 6
       name: floor_temp_limit
       type: integer
@@ -54,6 +54,7 @@ primary_entity:
       type: integer
       mapping:
         - scale: 10
+      hidden: true
     - id: 9
       name: hvac_mode
       type: boolean
@@ -69,15 +70,6 @@ primary_entity:
     - id: 12
       name: schedule
       type: string
-    - id: 21
-      name: unknown_21
-      type: boolean
-    - id: 22
-      name: power_rating
-      type: integer
-    - id: 23
-      name: unknown_23
-      type: integer
     - id: 24
       name: hvac_action
       type: string
@@ -89,10 +81,24 @@ primary_entity:
         - dps_val: Cooling
           value: cooling
     - id: 26
-      name: unknown_26
+      name: antifreeze_settings
       optional: true
       type: integer
 secondary_entities:
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 4
+        name: sensor
+        type: bitfield
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 4
+        name: fault_code
+        type: bitfield
   - entity: lock
     translation_key: child_lock
     category: config
@@ -225,3 +231,21 @@ secondary_entities:
         range:
           min: 0
           max: 3500
+  - entity: sensor
+    name: Power Consumption Duration
+    category: diagnostic
+    icon: "mdi:clock"
+    dps:
+      - id: 23
+        name: sensor
+        type: integer
+        class: measurement
+        unit: h
+  - entity: button
+    translation_key: factory_reset
+    category: config
+    dps:
+      - id: 21
+        type: boolean
+        optional: true
+        name: button

+ 0 - 264
custom_components/tuya_local/devices/thermoval_tvt40_thermostat.yaml

@@ -1,264 +0,0 @@
-name: Thermostat
-products:
-  - id: jIRwsT5yLPJO41Po
-    name: Thermoval TVT 40
-primary_entity:
-  entity: climate
-  translation_key: thermostat
-  dps:
-    - id: 2
-      name: temperature
-      type: integer
-      unit: C
-      range:
-        min: 50
-        max: 400
-      mapping:
-        - scale: 10
-          step: 5
-    - id: 3
-      name: preset_mode
-      type: string
-      mapping:
-        - dps_val: Smart
-          value: program
-          icon: "mdi:home-thermometer"
-        - dps_val: Anti_frozen
-          value: away
-          icon: "mdi:snowflake-melt"
-        - dps_val: Manual
-          value: manual
-          icon: "mdi:cursor-pointer"
-    - id: 5
-      name: current_temperature
-      type: integer
-      mapping:
-        - scale: 10
-          constraint: sensor_select
-          conditions:
-            - dps_val: "0"
-              value_redirect: floor_temperature
-    - id: 8
-      name: floor_temperature
-      type: integer
-      hidden: true
-    - id: 9
-      name: hvac_mode
-      type: boolean
-      readonly: true
-      mapping:
-        - dps_val: false
-          value: "heat"
-        - dps_val: true
-          value: "cool"
-    - id: 14
-      type: string
-      name: sensor_select
-      hidden: true
-    - id: 24
-      name: hvac_action
-      type: string
-      mapping:
-        - dps_val: Standby
-          value: idle
-        - dps_val: Heating
-          value: heating
-        - dps_val: Cooling
-          value: cooling
-    - id: 26
-      name: antifreeze_mode_settings
-      optional: true
-      type: integer
-secondary_entities:
-  - entity: binary_sensor
-    class: problem
-    category: diagnostic
-    dps:
-      - id: 4
-        name: sensor
-        type: bitfield
-        mapping:
-          - dps_val: 0
-            value: false
-          - value: true
-      - id: 4
-        name: fault_code
-        type: bitfield
-  - entity: lock
-    translation_key: child_lock
-    category: config
-    dps:
-      - id: 11
-        name: lock
-        type: boolean
-  - entity: number
-    name: Room temperature limit
-    category: config
-    class: temperature
-    icon: "mdi:thermometer-alert"
-    dps:
-      - id: 2
-        name: value
-        type: integer
-        unit: C
-        range:
-          min: 200
-          max: 500
-        mapping:
-          - scale: 10
-            step: 5
-  - entity: sensor
-    name: Room temperature
-    class: temperature
-    category: diagnostic
-    dps:
-      - id: 5
-        name: sensor
-        type: integer
-        class: measurement
-        unit: C
-        mapping:
-          - scale: 10
-  - entity: number
-    name: Floor temperature limit
-    category: config
-    class: temperature
-    icon: "mdi:thermometer-alert"
-    dps:
-      - id: 6
-        name: value
-        type: integer
-        unit: C
-        range:
-          min: 200
-          max: 500
-        mapping:
-          - scale: 10
-            step: 5
-  - entity: select
-    name: Installation
-    category: config
-    dps:
-      - id: 7
-        name: option
-        type: boolean
-        mapping:
-          - dps_val: true
-            value: Office
-            icon: "mdi:office-building-marker"
-          - dps_val: false
-            value: Home
-            icon: "mdi:home-map-marker"
-  - entity: sensor
-    name: Floor temperature
-    class: temperature
-    category: diagnostic
-    dps:
-      - id: 8
-        name: sensor
-        type: integer
-        class: measurement
-        unit: C
-        mapping:
-          - scale: 10
-  - entity: switch
-    name: Adaptive
-    icon: "mdi:school"
-    category: config
-    dps:
-      - id: 10
-        name: switch
-        type: boolean
-  - entity: select
-    name: Schedule
-    icon: "mdi:calendar-clock"
-    category: config
-    dps:
-      - id: 12
-        name: option
-        type: string
-        mapping:
-          - dps_val: "5_1_1"
-            value: "Weekdays+Sat+Sun"
-          - dps_val: "7"
-            value: "Daily"
-  - entity: select
-    name: Sensor select
-    icon: "mdi:home-thermometer"
-    category: config
-    dps:
-      - id: 14
-        name: option
-        type: string
-        mapping:
-          - dps_val: "0"
-            value: "Floor sensor"
-          - dps_val: "1"
-            value: "Room sensor"
-          - dps_val: "2"
-            value: "Room sensor with floor sensor limit"
-          - dps_val: "3"
-            value: "External room sensor"
-          - dps_val: "4"
-            value: "External room sensor with floor sensor limit"
-  - entity: number
-    name: Room temperature calibration
-    icon: "mdi:thermometer-check"
-    category: config
-    dps:
-      - id: 15
-        name: value
-        type: integer
-        unit: C
-        range:
-          min: -50
-          max: 50
-        mapping:
-          - scale: 10
-            step: 5
-  - entity: number
-    name: Floor temperature calibration
-    icon: "mdi:thermometer-check"
-    category: config
-    dps:
-      - id: 17
-        name: value
-        type: integer
-        unit: C
-        range:
-          min: -50
-          max: 50
-        mapping:
-          - scale: 10
-            step: 5
-  - entity: number
-    name: Power rating
-    category: config
-    class: power
-    icon: "mdi:signal"
-    dps:
-      - id: 22
-        name: value
-        type: integer
-        unit: W
-        range:
-          min: 0
-          max: 3500
-  - entity: sensor
-    name: Power Consumption Duration
-    category: diagnostic
-    icon: "mdi:clock"
-    dps:
-      - id: 23
-        name: sensor
-        type: integer
-        class: measurement
-        unit: h
-  - entity: button
-    translation_key: factory_reset
-    category: config
-    dps:
-      - id: 21
-        type: boolean
-        optional: true
-        name: button