Add EverLights light component (#19817)
* EverLights light integration. Supports single color (with color and brightness parameters) or saved pattern (with effect parameter). * Fix pylint parameter name warning. * Code review feedback. * Add tests for the two helper functions of EverLights component. * Fixes for review feedback. * Change test style. * Style fixes for hound.
This commit is contained in:
parent
5999df1953
commit
9482a6303d
4 changed files with 197 additions and 0 deletions
16
tests/components/light/test_everlights.py
Normal file
16
tests/components/light/test_everlights.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
"""The tests for the everlights component."""
|
||||
from homeassistant.components.light import everlights
|
||||
|
||||
|
||||
def test_color_rgb_to_int():
|
||||
"""Test RGB to integer conversion."""
|
||||
assert everlights.color_rgb_to_int(0x00, 0x00, 0x00) == 0x000000
|
||||
assert everlights.color_rgb_to_int(0xff, 0xff, 0xff) == 0xffffff
|
||||
assert everlights.color_rgb_to_int(0x12, 0x34, 0x56) == 0x123456
|
||||
|
||||
|
||||
def test_int_to_rgb():
|
||||
"""Test integer to RGB conversion."""
|
||||
assert everlights.color_int_to_rgb(0x000000) == (0x00, 0x00, 0x00)
|
||||
assert everlights.color_int_to_rgb(0xffffff) == (0xff, 0xff, 0xff)
|
||||
assert everlights.color_int_to_rgb(0x123456) == (0x12, 0x34, 0x56)
|
Loading…
Add table
Add a link
Reference in a new issue