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

Add support for (whitelabel?) illuminance sensor

Issue #626
Jason Rumney 2 лет назад
Родитель
Сommit
76b39729d8
3 измененных файлов с 32 добавлено и 0 удалено
  1. 1 0
      ACKNOWLEDGEMENTS.md
  2. 1 0
      DEVICES.md
  3. 30 0
      custom_components/tuya_local/devices/illumanance_sensor.yaml

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -258,3 +258,4 @@ Further device support has been made with the assistance of users.  Please consi
 - [spanzetta](https://github.com/spanzetta) for assisting with support for BLE connected HCT-611 water timer.
 - [MiloRoNu](https://github.com/MiloRoNu) for assisting with support for Neo IR Air Conditioner controller.
 - [jaydisc](https://github.com/jaydisc) for assisting with support for Orion DL021HA BLE locks.
+- [robertrebor](https://github.com/robertreor) for assisting with support for generic Illuminance sensors.

+ 1 - 0
DEVICES.md

@@ -350,6 +350,7 @@ of device.
 ### Miscellaneous
 
 - generic PIR motion sensor
+- generic illuminance sensor
 - Bresser smart 7-in-1 weather station
 - Catit Pixi smart fountain
 - Catit pet feeder (2.2kg dispenser and 6 meal versions)

+ 30 - 0
custom_components/tuya_local/devices/illumanance_sensor.yaml

@@ -0,0 +1,30 @@
+name: Illuminance sensor
+products:
+  - id: 8181077094b97e16d467
+primary_entity:
+  entity: sensor
+  name: Brightness
+  class: illuminance
+  dps:
+    - id: 2
+      type: integer
+      name: sensor
+      unit: lx
+      class: measurement
+secondary_entities:
+  - entity: sensor
+    name: Light level
+    class: enum
+    category: diagnostic
+    dps:
+      - id: 1
+        type: string
+        name: sensor
+        mapping:
+          - dps_val: low
+            value: Low
+          - dps_val: middle
+            value: Medium
+          - dps_val: high
+            value: High
+