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

EM3378: unit selectors only seem to affect display

Data from the device is always using Fahrenheit and hPa.

Change pressure unit options to match the units instead of spelling them
out in English. This will be more translation friendly.

Issue #419
Jason Rumney 1 год назад
Родитель
Сommit
91c31fa73d
1 измененных файлов с 15 добавлено и 45 удалено
  1. 15 45
      custom_components/tuya_local/devices/em3378_weather_station.yaml

+ 15 - 45
custom_components/tuya_local/devices/em3378_weather_station.yaml

@@ -13,18 +13,7 @@ primary_entity:
       class: measurement
       mapping:
         - scale: 10
-    - id: 112
-      type: boolean
-      name: unit
-      mapping:
-        - dps_val: true
-          value: F
-        - dps_val: false
-          value: C
-    - id: 117
-      name: fault
-      type: bitfield
-      optional: true
+      unit: F
       # we need the full range of values to expose this as a light control
     - id: 118
       name: backlight_brightness
@@ -35,7 +24,7 @@ primary_entity:
       # below is probably related to the built in USB charger, but is encoded
     - id: 122
       name: output_power
-      type: hex
+      type: string
 secondary_entities:
   - entity: sensor
     name: Indoor humidity
@@ -57,14 +46,7 @@ secondary_entities:
         class: measurement
         mapping:
           - scale: 10
-      - id: 112
-        type: boolean
-        name: unit
-        mapping:
-          - dps_val: false
-            value: C
-          - dps_val: true
-            value: F
+        unit: F
   - entity: sensor
     name: Remote humidity 1
     class: humidity
@@ -87,14 +69,7 @@ secondary_entities:
         optional: true
         mapping:
           - scale: 10
-      - id: 112
-        type: boolean
-        name: unit
-        mapping:
-          - dps_val: false
-            value: C
-          - dps_val: true
-            value: F
+        unit: F
   - entity: sensor
     name: Remote humidity 2
     class: humidity
@@ -118,14 +93,7 @@ secondary_entities:
         optional: true
         mapping:
           - scale: 10
-      - id: 112
-        type: boolean
-        name: unit
-        mapping:
-          - dps_val: false
-            value: C
-          - dps_val: true
-            value: F
+        unit: F
   - entity: sensor
     name: Remote humidity 3
     class: humidity
@@ -145,9 +113,7 @@ secondary_entities:
         type: integer
         name: sensor
         class: measurement
-      - id: 111
-        type: string
-        name: unit
+        unit: hPa
   - entity: select
     name: Atmospheric pressure unit
     icon: "mdi:gauge"
@@ -158,11 +124,11 @@ secondary_entities:
         name: option
         mapping:
           - dps_val: mmHg
-            value: mm of mercury
+            value: mmHg
           - dps_val: hPa
-            value: millibars
+            value: hPa
           - dps_val: inHg
-            value: inches of mercury
+            value: inHg
   - entity: select
     translation_key: temperature_unit
     category: config
@@ -171,9 +137,9 @@ secondary_entities:
         type: boolean
         name: option
         mapping:
-          - dps_val: false
-            value: celsius
           - dps_val: true
+            value: celsius
+          - dps_val: false
             value: fahrenheit
   - entity: binary_sensor
     class: problem
@@ -190,6 +156,10 @@ secondary_entities:
           - dps_val: 0
             value: false
           - value: true
+      - id: 117
+        name: fault_code
+        type: bitfield
+        optional: true
   - entity: select
     name: Time mode
     icon: "mdi:clock-edit"