Sfoglia il codice sorgente

SNT957W devices: apply correct scale.

Based on logs in #1907, all values are scaled by 10, and ranges of
original PR for temperatures seem to support that.  Humidity is also
scaled by 10 in the log, so adjusted some ranges to match.

Assume both variants (with and without humidity) are the saame.

Issue #1907
Jason Rumney 1 anno fa
parent
commit
cef1992c81

+ 18 - 4
custom_components/tuya_local/devices/snt957w_de_cbu_temp_humidity.yaml

@@ -50,6 +50,8 @@ secondary_entities:
         range:
         range:
           min: -400
           min: -400
           max: 1200
           max: 1200
+        mapping:
+          - scale: 10
   - entity: number
   - entity: number
     name: Low temperature limit
     name: Low temperature limit
     category: config
     category: config
@@ -63,6 +65,8 @@ secondary_entities:
         range:
         range:
           min: -400
           min: -400
           max: 1200
           max: 1200
+        mapping:
+          - scale: 10
   - entity: number
   - entity: number
     name: High humidity limit
     name: High humidity limit
     category: config
     category: config
@@ -74,7 +78,9 @@ secondary_entities:
         unit: "%"
         unit: "%"
         range:
         range:
           min: 0
           min: 0
-          max: 100
+          max: 1000
+        mapping:
+          - scale: 10
   - entity: number
   - entity: number
     name: Low humidity limit
     name: Low humidity limit
     category: config
     category: config
@@ -86,7 +92,9 @@ secondary_entities:
         unit: "%"
         unit: "%"
         range:
         range:
           min: 0
           min: 0
-          max: 100
+          max: 1000
+        mapping:
+          - scale: 10
   - entity: select
   - entity: select
     name: Temperature alarm
     name: Temperature alarm
     icon: "mdi:thermometer-alert"
     icon: "mdi:thermometer-alert"
@@ -125,9 +133,12 @@ secondary_entities:
       - id: 23
       - id: 23
         type: integer
         type: integer
         name: value
         name: value
+        unit: °
         range:
         range:
           min: -100
           min: -100
           max: 100
           max: 100
+        mapping:
+          - scale: 10
   - entity: number
   - entity: number
     name: Humidity calibration
     name: Humidity calibration
     category: config
     category: config
@@ -136,6 +147,9 @@ secondary_entities:
       - id: 24
       - id: 24
         type: integer
         type: integer
         name: value
         name: value
+        unit: "%"
         range:
         range:
-          min: -10
-          max: 10
+          min: -100
+          max: 100
+        mapping:
+          - scale: 10

+ 7 - 0
custom_components/tuya_local/devices/snt957w_tde_temp.yaml

@@ -40,6 +40,8 @@ secondary_entities:
         range:
         range:
           min: -400
           min: -400
           max: 1200
           max: 1200
+        mapping:
+          - scale: 10
   - entity: number
   - entity: number
     name: Low temperature limit
     name: Low temperature limit
     category: config
     category: config
@@ -53,6 +55,8 @@ secondary_entities:
         range:
         range:
           min: -400
           min: -400
           max: 1200
           max: 1200
+        mapping:
+          - scale: 10
   - entity: select
   - entity: select
     name: Temperature alarm
     name: Temperature alarm
     icon: "mdi:thermometer-alert"
     icon: "mdi:thermometer-alert"
@@ -76,6 +80,9 @@ secondary_entities:
       - id: 23
       - id: 23
         type: integer
         type: integer
         name: value
         name: value
+        unit: °
         range:
         range:
           min: -100
           min: -100
           max: 100
           max: 100
+        mapping:
+          - scale: 10