Browse Source

BLE plant moisture: expose temperature unit select entity

These sensors seem to need to be prodded to get them to update sensor
values.  The only writable dp is the temperature unit, which
previously wasn't exposed.

Exposing it should allow an automation to be set up to set the
temperature unit periodically. I am not sure whether the underlying
select platform will filter out attempts to set the option to what it
already is, but hopefully it will not require setting to a different value
which might cause flickering in the UI.

Issue #1696, Discussion #1910
Jason Rumney 1 năm trước cách đây
mục cha
commit
44b1f5b197

+ 12 - 0
custom_components/tuya_local/devices/ble_smart_plant_moisture.yaml

@@ -40,3 +40,15 @@ secondary_entities:
         type: integer
         name: sensor
         unit: "%"
+  - entity: select
+    translation_key: temperature_unit
+    category: config
+    dps:
+      - id: 9
+        type: string
+        name: option
+        mapping:
+          - dps_val: c
+            value: celsius
+          - dps_val: f
+            value: fahrenheit