UI-002: align context and activation status

This commit is contained in:
2026-06-14 15:28:52 +02:00
parent ede6b87dbd
commit 100f5af578
6 changed files with 42 additions and 5 deletions

View File

@@ -239,12 +239,25 @@ class ActuatorReconciliationService:
(candidate for candidate in numeric_candidates if candidate.auto_accepted),
None,
)
top_contexts = [
candidate.entity_id
accepted_contexts = [
candidate
for candidate in context_candidates
if candidate.auto_accepted
][: _MAX_CONTEXT_SELECTIONS]
top_contexts = [candidate.entity_id for candidate in accepted_contexts]
if top_numeric is None:
if accepted_contexts:
return AssignmentSelection(
selected_numeric_entity_id=None,
selected_context_entity_ids=top_contexts,
source=AssignmentSource.AUTOMATIC,
confidence=max(candidate.confidence for candidate in accepted_contexts),
review_required=False,
reason=(
"Passender Schaltkontext automatisch erkannt. Für diese "
"Verhaltensvorhersage ist kein numerischer Sensor erforderlich."
),
)
return AssignmentSelection(
selected_numeric_entity_id=None,
selected_context_entity_ids=top_contexts,