Explorar el Código

Feit dimmer: add optional dps

Add optional dps.  Minimum brightness does not seem useful, so added
as attribute of the light.  Bulb type added as select (may be how
minimum brightness is set, but UI is expected to use it which does not
translate to HA).

PR #752
Jason Rumney hace 2 años
padre
commit
8a508fbf3a
Se han modificado 3 ficheros con 30 adiciones y 32 borrados
  1. 1 0
      ACKNOWLEDGEMENTS.md
  2. 2 0
      DEVICES.md
  3. 27 32
      custom_components/tuya_local/devices/feit_dimmer.yaml

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -289,3 +289,4 @@ Further device support has been made with the assistance of users.  Please consi
 - [Xpl0jd](https://github.com/Xpl0jd) for contributing support for Nedis portable air conditioners.
 - [Xpl0jd](https://github.com/Xpl0jd) for contributing support for Nedis portable air conditioners.
 - [jirijanu](https://github.com/jirijanu) for assisting with support for ZTH08ZTU zigbee temperature and humidity sensors.
 - [jirijanu](https://github.com/jirijanu) for assisting with support for ZTH08ZTU zigbee temperature and humidity sensors.
 - [AndaPlays](https://github.com/AndaPlays) for assisting with support for Linkoze dual button wall switch.
 - [AndaPlays](https://github.com/AndaPlays) for assisting with support for Linkoze dual button wall switch.
+- [alexeyatbluescape](https://github.com/alexeyatbluescape) for contributing support for Feit dimmer.

+ 2 - 0
DEVICES.md

@@ -306,6 +306,8 @@ of device.
 - Deta/Arlec motion sensor lights (DET100HA/DET102HA/MAL315HA)
 - Deta/Arlec motion sensor lights (DET100HA/DET102HA/MAL315HA)
 - Deta 6910HA series2 dimmer switch
 - Deta 6910HA series2 dimmer switch
 - Dual-mode magic light string controller
 - Dual-mode magic light string controller
+- Feit dimmer (may work with other brands that just have a switch, dimmer and
+  optional minimum brightness and bulb type)
 - Galaxy Projector
 - Galaxy Projector
 - HDMI sync light
 - HDMI sync light
 - iHD001 LED controller
 - iHD001 LED controller

+ 27 - 32
custom_components/tuya_local/devices/feit_dimmer.yaml

@@ -1,13 +1,18 @@
-name: Feit Dimmer
+name: Dimmable light
 product:
 product:
   # https://www.feit.com/collections/smart-controls/products/smart-wi-fi-dimmer-dim-wifi
   # https://www.feit.com/collections/smart-controls/products/smart-wi-fi-dimmer-dim-wifi
   - id: tebc75erlgslgpn5
   - id: tebc75erlgslgpn5
+    name: Feit Dimmer
 primary_entity:
 primary_entity:
   entity: light
   entity: light
   dps:
   dps:
     - id: 1
     - id: 1
       name: switch
       name: switch
       type: boolean
       type: boolean
+      optional: true
+      mapping:
+        - dps_val: null
+          value: false
     - id: 2
     - id: 2
       name: brightness
       name: brightness
       type: integer
       type: integer
@@ -16,34 +21,24 @@ primary_entity:
         max: 1000
         max: 1000
       mapping:
       mapping:
         - scale: 3.92 # this is important for that device, else lights are too dim
         - scale: 3.92 # this is important for that device, else lights are too dim
-
-# optional, but does not let me select this file when I add new device
-# secondary_entities:
-
-# this is useless, does not actually limit brighness controls in my testing
-# - entity: number
-#   name: Minimum brightness
-#   category: config
-#   icon: "mdi:lightbulb-on-50"
-#   dps:
-#     - id: 3
-#       type: integer
-#       name: value
-#       range:
-#         min: 10
-#         max: 1000
-
-# this seems fine
-# - entity: select
-#   name: Light Type
-#   icon: mdi:lightbulb-variant
-#   # category: config
-#   dps:
-#     - id: 4
-#       type: string
-#       name: option
-#       mapping:
-#         - dps_val: incandescent
-#           value: Incandescent
-#         - dps_val: halogen
-#           value: LED
+      # advisory only, the integration does not actually use this, setting it
+      # does not seem to work, so probably determined by bulb type
+    - id: 3
+      type: integer
+      name: minimum_brightness
+      optional: true
+secondary_entities:
+  - entity: select
+    name: Light Type
+    icon: mdi:lightbulb-variant
+    category: config
+    dps:
+      - id: 4
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: incandescent
+            value: Incandescent
+          - dps_val: halogen
+            value: LED