hass-core/homeassistant/components/tuya
BNolet 6fbdcac323
Fix setting color + brightness of Tuya lights (#88470)
* Check if changing TO a color mode

Changing brightness alone does not change work mode, but changing brightness with a color value will keep the light in white mode. 

By verifying the new state has color or not, rather than the existing state being in color work mode, the light will change to color correctly.

Tuya interprets HSV as including the brightness in the (v) value (which is generally what that's used for when setting HSV values). The brightness value given by Home Assistant is still used in this case.

* Fix brightness-only turning colour mode to white

This will take into account the case where brightness is the only parameter for both the case of colour mode and white mode.

Tests passed after this change:

* Brightness only (colour mode) 
* Brightness only (white mode) 
* Colour only (colour mode) 
* Colour only (white mode) 
* Colour temp only (colour mode) 
* Colour temp only (white mode) 
* Colour + brightness (colour mode) 
* Colour + brightness (white mode) 
* Colour temp + brightness (colour mode) 
* Colour temp + brightness (white mode) 

* Fix code formatting
2023-03-28 12:20:54 +02:00
..
__init__.py Enable Ruff SIM300 (#86793) 2023-01-30 11:03:23 +01:00
alarm_control_panel.py
base.py Add Self typing (4) [mypy 1.0] (#87601) 2023-02-06 22:30:22 -06:00
binary_sensor.py Move EntityCategory to homeassistant.const (#87792) 2023-02-09 20:15:37 +01:00
button.py Move EntityCategory to homeassistant.const (#87792) 2023-02-09 20:15:37 +01:00
camera.py
climate.py Adjust set_humidity type hints (#85176) 2023-01-05 10:26:49 +01:00
config_flow.py
const.py Add some sensors and controls to tuya dehumidifier (#85380) 2023-01-16 22:58:01 +01:00
cover.py
diagnostics.py
fan.py Add some sensors and controls to tuya dehumidifier (#85380) 2023-01-16 22:58:01 +01:00
humidifier.py Adjust set_humidity type hints (#85176) 2023-01-05 10:26:49 +01:00
light.py Fix setting color + brightness of Tuya lights (#88470) 2023-03-28 12:20:54 +02:00
manifest.json Sort manifests 10 (#87031) 2023-02-08 20:41:50 +01:00
number.py Move EntityCategory to homeassistant.const (#87792) 2023-02-09 20:15:37 +01:00
scene.py
select.py Move EntityCategory to homeassistant.const (#87792) 2023-02-09 20:15:37 +01:00
sensor.py Adjust Tuya entity naming (#89616) 2023-03-13 09:23:04 +01:00
siren.py
strings.json
switch.py Adjust Tuya entity naming (#89616) 2023-03-13 09:23:04 +01:00
util.py
vacuum.py Improve type hints in tuya vacuum (#90041) 2023-03-21 13:25:19 +01:00