Restructure public config and deployment
This commit is contained in:
+34
-34
@@ -1,6 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from configs.example import GROUPS, LIGHTS
|
||||
from lights_config import GROUPS, LIGHTS
|
||||
from ha_deconz_bridge.color import Color
|
||||
from ha_deconz_bridge.debugger.web_debugger import _combine_specs, _group_debug_spec
|
||||
from ha_deconz_bridge.lights import ChannelSpec, ControllerModeSpec, ControllerSpec, VirtualLightSpec
|
||||
@@ -202,7 +202,7 @@ def test_onoff_booster_is_held_back_until_dimmables_are_exhausted() -> None:
|
||||
|
||||
|
||||
def test_brightness_mode_compensates_when_onoff_booster_turns_on() -> None:
|
||||
spec = _combine_specs(LIGHTS, ["Example Plug A", "Example Fixed White A"])
|
||||
spec = _combine_specs(LIGHTS, ["Floor Lamp Plug", "Plant Light Left"])
|
||||
model = compile_light_model(spec)
|
||||
target = Color.from_rgb((255, 255, 255), brightness=1.0)
|
||||
|
||||
@@ -407,7 +407,7 @@ def test_ct_line_balancing_uses_comparable_same_label_channels_stably() -> None:
|
||||
|
||||
|
||||
def test_rgb_request_does_not_use_white_boost_when_rgb_labeled_channels_exist() -> None:
|
||||
spec = _combine_specs(LIGHTS, ["Example Fixed White A", "Example Mixed North"])
|
||||
spec = _combine_specs(LIGHTS, ["Plant Light Left", "Living Room Ceiling"])
|
||||
model = compile_light_model(spec)
|
||||
target = Color.from_rgb((255, 255, 255), brightness=1.0)
|
||||
|
||||
@@ -418,19 +418,19 @@ def test_rgb_request_does_not_use_white_boost_when_rgb_labeled_channels_exist()
|
||||
|
||||
|
||||
def test_example_fixed_white_controller_uses_full_ct_command_range() -> None:
|
||||
controller = LIGHTS["Example Fixed White A"].controllers["fixed_a"]
|
||||
controller = LIGHTS["Plant Light Left"].controllers["fixed_a"]
|
||||
assert controller.native_ct_mireds == (153, 500)
|
||||
|
||||
|
||||
def test_example_standard_ct_controllers_use_configured_ct_command_range() -> None:
|
||||
for light_name in ["Example Mixed North", "Example Hall Floor", "Example Hall Corner", "Example Hall Cabinets"]:
|
||||
for light_name in ["Living Room Ceiling", "Hallway Floor Light", "Hallway Corner Light", "Hallway Cabinet Lights"]:
|
||||
for controller in LIGHTS[light_name].controllers.values():
|
||||
if "color_temp" in controller.modes:
|
||||
assert controller.native_ct_mireds == (153, 500)
|
||||
|
||||
|
||||
def test_ct_request_uses_native_ct_mode_on_rgb_cct_controller() -> None:
|
||||
spec = LIGHTS["Example Kitchen Counter"]
|
||||
spec = LIGHTS["Kitchen Counter Lights"]
|
||||
result = solve_light(
|
||||
compile_light_model(spec),
|
||||
Color.from_color_temp(455, brightness=1.0),
|
||||
@@ -542,7 +542,7 @@ def test_ct_slack_does_not_use_near_ct_when_outside_band() -> None:
|
||||
|
||||
|
||||
def test_wc_ct_sweep_stays_near_requested_ct_line_through_middle_range() -> None:
|
||||
spec = _group_debug_spec(GROUPS["Example Bathroom"], LIGHTS)
|
||||
spec = _group_debug_spec(GROUPS["Bathroom"], LIGHTS)
|
||||
model = compile_light_model(spec)
|
||||
|
||||
for mireds in [220, 250, 286, 320, 360]:
|
||||
@@ -559,7 +559,7 @@ def test_wc_ct_sweep_stays_near_requested_ct_line_through_middle_range() -> None
|
||||
|
||||
|
||||
def test_wc_low_brightness_ct_can_use_rgb_correction_without_redefining_reference() -> None:
|
||||
spec = _group_debug_spec(GROUPS["Example Bathroom"], LIGHTS)
|
||||
spec = _group_debug_spec(GROUPS["Bathroom"], LIGHTS)
|
||||
model = compile_light_model(spec)
|
||||
target = Color.from_color_temp(286, brightness=1.0, temp_range=spec.exposed_mireds)
|
||||
|
||||
@@ -573,7 +573,7 @@ def test_wc_low_brightness_ct_can_use_rgb_correction_without_redefining_referenc
|
||||
|
||||
|
||||
def test_wc_katto_low_brightness_ct_can_sacrifice_one_bulb_for_rgb_correction() -> None:
|
||||
spec = LIGHTS["Example Bathroom Ceiling"]
|
||||
spec = LIGHTS["Bathroom Ceiling Light"]
|
||||
model = compile_light_model(spec)
|
||||
target = Color.from_color_temp(286, brightness=1.0, temp_range=spec.exposed_mireds)
|
||||
|
||||
@@ -593,7 +593,7 @@ def test_wc_katto_low_brightness_ct_can_sacrifice_one_bulb_for_rgb_correction()
|
||||
|
||||
|
||||
def test_wc_katto_balances_equivalent_channels() -> None:
|
||||
spec = LIGHTS["Example Bathroom Ceiling"]
|
||||
spec = LIGHTS["Bathroom Ceiling Light"]
|
||||
model = compile_light_model(spec)
|
||||
target = Color.from_color_temp(300, brightness=1.0, temp_range=spec.exposed_mireds)
|
||||
|
||||
@@ -614,14 +614,14 @@ def test_example_all_lights_does_not_branch_on_dimmable_off_states() -> None:
|
||||
spec = _combine_specs(
|
||||
LIGHTS,
|
||||
[
|
||||
"Example Fixed White A",
|
||||
"Example Fixed White B",
|
||||
"Example Mixed North",
|
||||
"Example Plug A",
|
||||
"Example Plug B",
|
||||
"Example Hall Floor",
|
||||
"Example Hall Corner",
|
||||
"Example Hall Cabinets",
|
||||
"Plant Light Left",
|
||||
"Plant Light Right",
|
||||
"Living Room Ceiling",
|
||||
"Floor Lamp Plug",
|
||||
"Desk Lamp Plug",
|
||||
"Hallway Floor Light",
|
||||
"Hallway Corner Light",
|
||||
"Hallway Cabinet Lights",
|
||||
],
|
||||
)
|
||||
model = compile_light_model(spec)
|
||||
@@ -632,14 +632,14 @@ def test_example_all_lights_deduplicates_reference_combinations() -> None:
|
||||
spec = _combine_specs(
|
||||
LIGHTS,
|
||||
[
|
||||
"Example Fixed White A",
|
||||
"Example Fixed White B",
|
||||
"Example Mixed North",
|
||||
"Example Plug A",
|
||||
"Example Plug B",
|
||||
"Example Hall Floor",
|
||||
"Example Hall Corner",
|
||||
"Example Hall Cabinets",
|
||||
"Plant Light Left",
|
||||
"Plant Light Right",
|
||||
"Living Room Ceiling",
|
||||
"Floor Lamp Plug",
|
||||
"Desk Lamp Plug",
|
||||
"Hallway Floor Light",
|
||||
"Hallway Corner Light",
|
||||
"Hallway Cabinet Lights",
|
||||
],
|
||||
)
|
||||
model = compile_light_model(spec)
|
||||
@@ -650,14 +650,14 @@ def test_example_all_lights_ct_sweep_does_not_use_unused_onoff_reference() -> No
|
||||
spec = _combine_specs(
|
||||
LIGHTS,
|
||||
[
|
||||
"Example Fixed White A",
|
||||
"Example Fixed White B",
|
||||
"Example Mixed North",
|
||||
"Example Plug A",
|
||||
"Example Plug B",
|
||||
"Example Hall Floor",
|
||||
"Example Hall Corner",
|
||||
"Example Hall Cabinets",
|
||||
"Plant Light Left",
|
||||
"Plant Light Right",
|
||||
"Living Room Ceiling",
|
||||
"Floor Lamp Plug",
|
||||
"Desk Lamp Plug",
|
||||
"Hallway Floor Light",
|
||||
"Hallway Corner Light",
|
||||
"Hallway Cabinet Lights",
|
||||
],
|
||||
)
|
||||
model = compile_light_model(spec)
|
||||
|
||||
Reference in New Issue
Block a user