Use eventloop for scheduling (#37184)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
1 parent
0f72008090
commit
89a9634d35
42 files changed
+366
-272
No files matched your search
@@ -282,7 +282,7 @@ async def test_flux_before_sunrise_known_location(hass):
|
||||
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
async def test_flux_after_sunrise_before_sunset(hass):
|
||||
async def test_flux_after_sunrise_before_sunset(hass, legacy_patchable_time):
|
||||
"""Test the flux switch after sunrise and before sunset."""
|
||||
platform = getattr(hass.components, "test.light")
|
||||
platform.init()
|
||||
@@ -336,7 +336,7 @@ async def test_flux_after_sunrise_before_sunset(hass):
|
||||
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
async def test_flux_after_sunset_before_stop(hass):
|
||||
async def test_flux_after_sunset_before_stop(hass, legacy_patchable_time):
|
||||
"""Test the flux switch after sunset and before stop."""
|
||||
platform = getattr(hass.components, "test.light")
|
||||
platform.init()
|
||||
@@ -391,7 +391,7 @@ async def test_flux_after_sunset_before_stop(hass):
|
||||
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
async def test_flux_after_stop_before_sunrise(hass):
|
||||
async def test_flux_after_stop_before_sunrise(hass, legacy_patchable_time):
|
||||
"""Test the flux switch after stop and before sunrise."""
|
||||
platform = getattr(hass.components, "test.light")
|
||||
platform.init()
|
||||
@@ -445,7 +445,7 @@ async def test_flux_after_stop_before_sunrise(hass):
|
||||
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
async def test_flux_with_custom_start_stop_times(hass):
|
||||
async def test_flux_with_custom_start_stop_times(hass, legacy_patchable_time):
|
||||
"""Test the flux with custom start and stop times."""
|
||||
platform = getattr(hass.components, "test.light")
|
||||
platform.init()
|
||||
@@ -558,7 +558,9 @@ async def test_flux_before_sunrise_stop_next_day(hass):
|
||||
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
async def test_flux_after_sunrise_before_sunset_stop_next_day(hass):
|
||||
async def test_flux_after_sunrise_before_sunset_stop_next_day(
|
||||
hass, legacy_patchable_time
|
||||
):
|
||||
"""
|
||||
Test the flux switch after sunrise and before sunset.
|
||||
|
||||
@@ -618,7 +620,9 @@ async def test_flux_after_sunrise_before_sunset_stop_next_day(hass):
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
@pytest.mark.parametrize("x", [0, 1])
|
||||
async def test_flux_after_sunset_before_midnight_stop_next_day(hass, x):
|
||||
async def test_flux_after_sunset_before_midnight_stop_next_day(
|
||||
hass, legacy_patchable_time, x
|
||||
):
|
||||
"""Test the flux switch after sunset and before stop.
|
||||
|
||||
This test has the stop_time on the next day (after midnight).
|
||||
@@ -792,7 +796,7 @@ async def test_flux_after_stop_before_sunrise_stop_next_day(hass):
|
||||
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
async def test_flux_with_custom_colortemps(hass):
|
||||
async def test_flux_with_custom_colortemps(hass, legacy_patchable_time):
|
||||
"""Test the flux with custom start and stop colortemps."""
|
||||
platform = getattr(hass.components, "test.light")
|
||||
platform.init()
|
||||
@@ -849,7 +853,7 @@ async def test_flux_with_custom_colortemps(hass):
|
||||
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
async def test_flux_with_custom_brightness(hass):
|
||||
async def test_flux_with_custom_brightness(hass, legacy_patchable_time):
|
||||
"""Test the flux with custom start and stop colortemps."""
|
||||
platform = getattr(hass.components, "test.light")
|
||||
platform.init()
|
||||
@@ -904,7 +908,7 @@ async def test_flux_with_custom_brightness(hass):
|
||||
assert call.data[light.ATTR_XY_COLOR] == [0.506, 0.385]
|
||||
|
||||
|
||||
async def test_flux_with_multiple_lights(hass):
|
||||
async def test_flux_with_multiple_lights(hass, legacy_patchable_time):
|
||||
"""Test the flux switch with multiple light entities."""
|
||||
platform = getattr(hass.components, "test.light")
|
||||
platform.init()
|
||||
@@ -982,7 +986,7 @@ async def test_flux_with_multiple_lights(hass):
|
||||
assert call.data[light.ATTR_XY_COLOR] == [0.46, 0.376]
|
||||
|
||||
|
||||
async def test_flux_with_mired(hass):
|
||||
async def test_flux_with_mired(hass, legacy_patchable_time):
|
||||
"""Test the flux switch´s mode mired."""
|
||||
platform = getattr(hass.components, "test.light")
|
||||
platform.init()
|
||||
@@ -1034,7 +1038,7 @@ async def test_flux_with_mired(hass):
|
||||
assert call.data[light.ATTR_COLOR_TEMP] == 269
|
||||
|
||||
|
||||
async def test_flux_with_rgb(hass):
|
||||
async def test_flux_with_rgb(hass, legacy_patchable_time):
|
||||
"""Test the flux switch´s mode rgb."""
|
||||
platform = getattr(hass.components, "test.light")
|
||||
platform.init()
|
||||
|
||||
Reference in new issue
Block a user