tuanchris пре 3 месеци
родитељ
комит
9297eb1e72

+ 5 - 1
modules/connection/connection_manager.py

@@ -207,9 +207,13 @@ def connect_device(homing=True):
     if (state.conn.is_connected() if state.conn else False):
         device_init(homing)
 
-    # Show connected effect
+    # Show connected effect, then transition to configured idle effect
     if state.led_controller:
+        logger.info("Showing LED connected effect (green flash)")
         state.led_controller.effect_connected()
+        # Set the configured idle effect after connection
+        logger.info(f"Setting LED to idle effect: {state.hyperion_idle_effect}")
+        state.led_controller.effect_idle(state.hyperion_idle_effect)
 
 def get_status_response() -> str:
     """

+ 2 - 0
modules/core/pattern_manager.py

@@ -635,6 +635,7 @@ async def run_theta_rho_file(file_path, is_playlist=False):
         
         start_time = time.time()
         if state.led_controller:
+            logger.info(f"Setting LED to playing effect: {state.hyperion_playing_effect}")
             state.led_controller.effect_playing(state.hyperion_playing_effect)
             
         with tqdm(
@@ -731,6 +732,7 @@ async def run_theta_rho_file(file_path, is_playlist=False):
         
         # Set LED back to idle when pattern completes normally (not stopped early)
         if state.led_controller and not state.stop_requested:
+            logger.info(f"Setting LED to idle effect: {state.hyperion_idle_effect}")
             state.led_controller.effect_idle(state.hyperion_idle_effect)
             logger.debug("LED effect set to idle after pattern completion")
         

+ 7 - 2
modules/led/hyperion_controller.py

@@ -227,7 +227,12 @@ def effect_idle(hyperion_controller: HyperionController, effect_name: str = "off
 
 
 def effect_connected(hyperion_controller: HyperionController) -> bool:
-    """Show connected effect - green flash"""
+    """Show connected effect - green flash
+
+    Note: This function only shows the connection flash. The calling code
+    should explicitly set the idle effect afterwards to ensure the user's
+    configured idle effect is used.
+    """
     # Turn on Hyperion first
     hyperion_controller.set_power(1)
     time.sleep(0.2)  # Give Hyperion time to power on
@@ -239,7 +244,7 @@ def effect_connected(hyperion_controller: HyperionController) -> bool:
     time.sleep(1.2)  # Wait for flash to complete
     res = hyperion_controller.set_color(r=8, g=255, b=0, duration=1000)
     time.sleep(1.2)  # Wait for flash to complete
-    effect_idle(hyperion_controller)
+    # Don't call effect_idle here - let the caller set the configured idle effect
     return res.get('connected', False)