Преглед изворни кода

Lightbulbs: scale brightness properly.

Some recently added lightbulbs did not scale the brightness into the expected
0-255 range.

Affects CCT lightbulb, Mantra fan, PIR spotlight, Tampa LED system

- also removed useless and empty null mapping from non-optional dp of RGBCW lightbulb.

Based on PR #830
Jason Rumney пре 2 година
родитељ
комит
19d509f2ef

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -305,3 +305,4 @@ Further device support has been made with the assistance of users.  Please consi
 - [mild-delirium](https://github.com/mild-delirium) for contributing a bugfix for polling devices.
 - [mild-delirium](https://github.com/mild-delirium) for contributing a bugfix for polling devices.
 - [jorgejavier2321](https://github.com/jorgejavier2321) for assisting with support for Mantra ceiling fans.
 - [jorgejavier2321](https://github.com/jorgejavier2321) for assisting with support for Mantra ceiling fans.
 - [diystu](https://github.com/diystu) for assisting with support for Aulifants SMES200 breaker switch.
 - [diystu](https://github.com/diystu) for assisting with support for Aulifants SMES200 breaker switch.
+- [mariustt](https://github.com/mariustt) for assisting with support for Tampa LED lighting system.

+ 1 - 0
DEVICES.md

@@ -325,6 +325,7 @@ of device.
 - Moes dimmer switch
 - Moes dimmer switch
 - Moes motion sensor lights (XZ-CGV3)
 - Moes motion sensor lights (XZ-CGV3)
 - Space Dog Music Lamp
 - Space Dog Music Lamp
+- Tampa Magnetic LED System CD-TY-WY05
 
 
 ### Covers
 ### Covers
 
 

+ 2 - 0
custom_components/tuya_local/devices/cct_lightbulb.yaml

@@ -19,6 +19,8 @@ primary_entity:
       range:
       range:
         min: 10
         min: 10
         max: 1000
         max: 1000
+      mapping:
+        - scale: 3.92
     - id: 23
     - id: 23
       name: color_temp
       name: color_temp
       type: integer
       type: integer

+ 2 - 0
custom_components/tuya_local/devices/mantra_fan.yaml

@@ -129,6 +129,8 @@ secondary_entities:
         range:
         range:
           min: 10
           min: 10
           max: 1000
           max: 1000
+        mapping:
+          - scale: 3.92
       - id: 11
       - id: 11
         name: color_temp
         name: color_temp
         type: integer
         type: integer

+ 0 - 1
custom_components/tuya_local/devices/pir_spotlight.yaml

@@ -19,7 +19,6 @@ primary_entity:
         min: 10
         min: 10
         max: 1000
         max: 1000
       mapping:
       mapping:
-        - dps_val: null
         - scale: 3.92
         - scale: 3.92
     - id: 23
     - id: 23
       name: color_temp
       name: color_temp

+ 1 - 0
custom_components/tuya_local/devices/rgbcw_lightbulb.yaml

@@ -35,6 +35,7 @@ primary_entity:
         max: 1000
         max: 1000
       mapping:
       mapping:
         - dps_val: null
         - dps_val: null
+          value: 0
         - scale: 3.92
         - scale: 3.92
     - id: 23
     - id: 23
       name: color_temp
       name: color_temp

+ 2 - 0
custom_components/tuya_local/devices/tampa_led_system.yaml

@@ -17,6 +17,8 @@ primary_entity:
       range:
       range:
         min: 0
         min: 0
         max: 1000
         max: 1000
+      mapping:
+        - scale: 3.92
     - id: 4
     - id: 4
       name: color_temp
       name: color_temp
       type: integer
       type: integer