Pārlūkot izejas kodu

BLE Plant Moisture: Only use unit dp as read-only units

It does not need to be a human readable sensor, but assume it reports correctly even though it doesn't seem possible to change it, and use if for the temperature unit.

PR #1696
Jason Rumney 2 gadi atpakaļ
vecāks
revīzija
2509320262

+ 5 - 11
custom_components/tuya_local/devices/ble_smart_plant_moisture.yaml

@@ -21,20 +21,14 @@ secondary_entities:
         type: integer
         type: integer
         class: measurement
         class: measurement
         mapping:
         mapping:
-          - scale: 10
-        unit: C
-  - entity: sensor
-    name: Temperature unit
-    category: diagnostic
-    dps:
+          - scale: 10  
       - id: 9
       - id: 9
-        name: option
+        name: unit
         type: string
         type: string
         mapping:
         mapping:
-          - dps_val: "f"
-            value: fahrenheit
-          - dps_val: "c"
-            value: celsius
+          - dps_val: f
+            value: F
+          - value: C
   - entity: sensor
   - entity: sensor
     class: battery
     class: battery
     category: diagnostic
     category: diagnostic