Add "Always" condition type to profiles

- Add AlwaysCondition model and evaluation (always returns true)
- Add condition type selector (Always/Application) in profile editor
- Show condition type pill on profile cards
- Fix misleading empty-conditions text (was "never activate", actually always active)
- Add i18n keys for Always condition (en + ru)
- Add CSS for condition type selector and description

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-25 14:38:25 +03:00
parent 466527bd4a
commit 701eac19e5
6 changed files with 101 additions and 38 deletions

View File

@@ -5,7 +5,7 @@ from datetime import datetime, timezone
from typing import Dict, Optional, Set
from wled_controller.core.profiles.platform_detector import PlatformDetector
from wled_controller.storage.profile import ApplicationCondition, Condition, Profile
from wled_controller.storage.profile import AlwaysCondition, ApplicationCondition, Condition, Profile
from wled_controller.storage.profile_store import ProfileStore
from wled_controller.utils import get_logger
@@ -158,6 +158,8 @@ class ProfileEngine:
topmost_proc: Optional[str], topmost_fullscreen: bool,
fullscreen_procs: Set[str],
) -> bool:
if isinstance(condition, AlwaysCondition):
return True
if isinstance(condition, ApplicationCondition):
return self._evaluate_app_condition(condition, running_procs, topmost_proc, topmost_fullscreen, fullscreen_procs)
return False