Tesla charge_limit_soc = strop, ne cíl session
Patch po příjezdu přepisoval target_soc_pct limitem auta (LFP 100 %) a zahazoval kaskádu fn_ev_session_defaults (default vozidla 30 %) — auto by se v noci tlačilo do plna ze sítě proti vůli majitele (session #2 dnes). Nově se target snižuje jen pokud je limit auta POD ním; fn_tesla_arrival_context vrací i target_soc_pct session. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -216,8 +216,13 @@ async def _patch_session_from_tesla(
|
||||
)
|
||||
|
||||
patch: dict = {"soc_at_connect_pct": state["battery_level"]}
|
||||
if state.get("charge_limit_soc"):
|
||||
patch["target_soc_pct"] = state["charge_limit_soc"]
|
||||
# Tesla charge_limit_soc je STROP (nad něj auto nenabije), NE cíl —
|
||||
# cíl drží kaskáda fn_ev_session_defaults (weekly/forecast/default
|
||||
# vozidla, např. 30 %). Snižovat target jen když limit auta je POD ním.
|
||||
limit = state.get("charge_limit_soc")
|
||||
current_target = ctx.get("target_soc_pct")
|
||||
if limit and current_target is not None and float(current_target) > float(limit):
|
||||
patch["target_soc_pct"] = limit
|
||||
import json as _json
|
||||
await fetch_json(
|
||||
conn,
|
||||
|
||||
Reference in New Issue
Block a user