Преглед на файлове

Smartplug USB: make config entities and sensors optional

- Config entities are missing on some plugs (even with the same product id)
- sensors are marked as force: true, but were not optional.
  Atributes that require forced updates are not always reported without
  that forcing, so must be optional.

Discussion #2126
Jason Rumney преди 1 година
родител
ревизия
4bf6f3c529
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  1. 5 0
      custom_components/tuya_local/devices/smartplug_usb.yaml

+ 5 - 0
custom_components/tuya_local/devices/smartplug_usb.yaml

@@ -33,6 +33,7 @@ secondary_entities:
         name: sensor
         type: integer
         class: measurement
+        optional: true
         force: true
         unit: V
         mapping:
@@ -50,6 +51,7 @@ secondary_entities:
         type: integer
         class: measurement
         force: true
+        optional: true
         unit: mA
       - id: 23
         type: integer
@@ -64,6 +66,7 @@ secondary_entities:
         type: integer
         class: measurement
         force: true
+        optional: true
         unit: W
         mapping:
           - scale: 10
@@ -108,6 +111,7 @@ secondary_entities:
     dps:
       - id: 38
         type: string
+        optional: true
         name: option
         mapping:
           - dps_val: power_on
@@ -124,6 +128,7 @@ secondary_entities:
       - id: 39
         type: string
         name: option
+        optional: true
         mapping:
           - dps_val: relay
             value: State