hass-core/tests/components/light
Bob Clough 2e973c7572 Fix mqtt light brightness slider (#17075)
* Enable brightness slider for RGB

If we are using RGB with no brightness topic, the brighness slider
should still be visible, as we can scale the RGB amount to give us the
brightness.

* Output RGB scaled by brightness

If we are outputting to an RGB device, but do not have a dedicated
brightness topic set, when the brightness slider is changed, we should
output the current colour's HS, with the V coming from the brightness
slider.

* Brightness from RGB when we're not using a brightness topic

When we aren't using a brightness topic, set the brightness slider based
on the received value from an RGB -> HSV conversion.

* Test for new brightness state scaled by RGB

This adds a test to make sure the brightness stored in the state is
being computed correctly from the RGB value when a dedicated brightness
topic is not set.

* Changes from review

Fixes formatting of supported features flags, and checks HS colour
hasn't been set when operating in RGB-only mode

* Set optimistic brightness correctly in rgb mode

When we're using rgb mode to set the brightness, we want to set
optimistic brightness if:

we are running in optimistic mode
OR
the brightness state topic isn't set and we have a brightness command topic
OR
the rgb state topic isn't set and we don't have a brightness command topic

* Add test for turn_on in RGB brightness mode
2018-10-20 12:37:25 -04:00
..
__init__.py Fix PEP257 issues 2016-03-09 10:25:50 +01:00
common.py Remove service helper (5) (#16917) 2018-09-27 23:13:11 +02:00
test_deconz.py deCONZ add via_hub attribute for device registry (#16760) 2018-09-21 09:21:44 +02:00
test_demo.py Remove service helper (5) (#16917) 2018-09-27 23:13:11 +02:00
test_group.py Remove service helper (5) (#16917) 2018-09-27 23:13:11 +02:00
test_hue.py Add config entries to connection class (#16618) 2018-09-17 10:12:46 +02:00
test_init.py Remove service helper (5) (#16917) 2018-09-27 23:13:11 +02:00
test_litejet.py Remove service helper (5) (#16917) 2018-09-27 23:13:11 +02:00
test_mochad.py Device Registry (#15980) 2018-08-22 10:46:37 +02:00
test_mqtt.py Fix mqtt light brightness slider (#17075) 2018-10-20 12:37:25 -04:00
test_mqtt_json.py Remove discovered mqtt_json light entity when discovery is cleared (#16906) 2018-09-28 00:25:51 +02:00
test_mqtt_template.py Remove service helper (5) (#16917) 2018-09-27 23:13:11 +02:00
test_rflink.py More entity service (#15998) 2018-08-16 14:28:59 +02:00
test_rfxtrx.py Grammar and spelling fixes (#16065) 2018-08-19 22:29:08 +02:00
test_template.py Remove service helper (5) (#16917) 2018-09-27 23:13:11 +02:00
test_tradfri.py Config flow tradfri (#16665) 2018-09-19 21:21:43 +02:00
test_zwave.py Changing z-wave brightness calculation to respect 0x01 and 0x02 byte values (#16420) 2018-09-13 10:38:07 -04:00