Add room management settings
This commit is contained in:
@@ -546,6 +546,25 @@ class ActuatorReconciliationService:
|
||||
if candidate.auto_accepted
|
||||
][: _MAX_CONTEXT_SELECTIONS]
|
||||
top_contexts = [candidate.entity_id for candidate in accepted_contexts]
|
||||
if (
|
||||
top_numeric is not None
|
||||
and actuator.domain in {"light", "switch"}
|
||||
and any(
|
||||
(candidate.device_class or "") in {"door", "garage_door", "opening", "window"}
|
||||
for candidate in 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=(
|
||||
"Tür-/Öffnungskontext automatisch erkannt. Für diese "
|
||||
"direkte Schaltlogik ist kein Helligkeitssensor erforderlich."
|
||||
),
|
||||
)
|
||||
if top_numeric is None:
|
||||
if accepted_contexts:
|
||||
return AssignmentSelection(
|
||||
|
||||
Reference in New Issue
Block a user