Restructure public config and deployment
This commit is contained in:
+19
-19
@@ -253,10 +253,10 @@ def test_runtime_ha_command_updates_all_overlapping_virtual_lights(
|
||||
|
||||
|
||||
def test_load_config_module_by_path_supports_repo_config_imports() -> None:
|
||||
module = load_config_module("configs/example.py")
|
||||
module = load_config_module("config.example/lights_config.py")
|
||||
|
||||
assert "Example Mixed North" in module.LIGHTS
|
||||
assert "Example Living" in module.GROUPS
|
||||
assert "Living Room Ceiling" in module.LIGHTS
|
||||
assert "Living Room" in module.GROUPS
|
||||
|
||||
|
||||
def test_warmup_requests_cover_supported_modes(rgb_light_spec, ct_light_spec) -> None:
|
||||
@@ -682,9 +682,9 @@ def test_runtime_relative_group_readback_uses_aggregate_output(settings, monkeyp
|
||||
|
||||
|
||||
def test_example_room_scene_reports_requested_brightness_and_ct(settings, monkeypatch) -> None:
|
||||
from configs.example_actions import scene
|
||||
from configs.example_groups import GROUPS
|
||||
from configs.example_lights import LIGHTS
|
||||
from actions import scene
|
||||
from groups import GROUPS
|
||||
from lights import LIGHTS
|
||||
|
||||
resources = {
|
||||
controller_id: _resource_for_controller(controller)
|
||||
@@ -705,9 +705,9 @@ def test_example_room_scene_reports_requested_brightness_and_ct(settings, monkey
|
||||
(4000, 255, 250),
|
||||
(5500, 255, 182),
|
||||
):
|
||||
app._run_action(scene("Example Kitchen", brightness=brightness, kelvin=kelvin))
|
||||
app._run_action(scene("Kitchen", brightness=brightness, kelvin=kelvin))
|
||||
|
||||
state = app.group_lights["Example Kitchen"].state
|
||||
state = app.group_lights["Kitchen"].state
|
||||
assert state.brightness == brightness
|
||||
assert state.color.color_temp == mireds
|
||||
|
||||
@@ -716,9 +716,9 @@ def test_example_group_readback_uses_aggregate_member_output(
|
||||
settings,
|
||||
monkeypatch,
|
||||
) -> None:
|
||||
from configs.example_actions import scene
|
||||
from configs.example_groups import GROUPS
|
||||
from configs.example_lights import LIGHTS
|
||||
from actions import scene
|
||||
from groups import GROUPS
|
||||
from lights import LIGHTS
|
||||
|
||||
resources = {
|
||||
controller_id: _resource_for_controller(controller)
|
||||
@@ -730,21 +730,21 @@ def test_example_group_readback_uses_aggregate_member_output(
|
||||
monkeypatch.setattr("ha_deconz_bridge.app.HomeAssistantBridge", lambda _settings: RecordingBridge())
|
||||
app = HaDeconzBridgeApp(settings, LIGHTS, groups=GROUPS)
|
||||
|
||||
app._run_action(scene("Example Living", brightness=51, kelvin=2200))
|
||||
app.group_lights["Example Living"].clear_accepted()
|
||||
state = app.group_lights["Example Living"].handle_member_update()
|
||||
app._run_action(scene("Living Room", brightness=51, kelvin=2200))
|
||||
app.group_lights["Living Room"].clear_accepted()
|
||||
state = app.group_lights["Living Room"].handle_member_update()
|
||||
|
||||
assert 45 <= state.brightness <= 60
|
||||
assert app.lights["Example Plug A"].state.brightness == 255
|
||||
assert app.lights["Example Plug B"].state.brightness == 255
|
||||
assert app.lights["Floor Lamp Plug"].state.brightness == 255
|
||||
assert app.lights["Desk Lamp Plug"].state.brightness == 255
|
||||
|
||||
|
||||
def test_example_native_ct_member_reports_requested_ct(settings) -> None:
|
||||
from configs.example_lights import LIGHTS
|
||||
from lights import LIGHTS
|
||||
|
||||
light, _bridge, _backend = _build_light(LIGHTS["Example Bedroom West"], settings)
|
||||
light, _bridge, _backend = _build_light(LIGHTS["Bedroom Left Lamp"], settings)
|
||||
|
||||
state = light.handle_ha_command(HaCommandEvent("Example Bedroom West", on=True, brightness=153, color_temp=333))
|
||||
state = light.handle_ha_command(HaCommandEvent("Bedroom Left Lamp", on=True, brightness=153, color_temp=333))
|
||||
|
||||
assert state.brightness == 153
|
||||
assert state.color.color_temp == 333
|
||||
|
||||
Reference in New Issue
Block a user