Branch 4: BA81 GEN cutoff audit + exekuce při sell<0
This commit is contained in:
@@ -93,6 +93,27 @@ def _deye_reg178_verify_match(expected_i: int, actual_i: int) -> bool:
|
||||
)
|
||||
|
||||
|
||||
def deye_mi_export_cutoff_want_enabled(
|
||||
*,
|
||||
gen_microinverter_cutoff_enabled: bool,
|
||||
deye_gen_cutoff_enabled: bool,
|
||||
export_ban: bool,
|
||||
deye_mode: str,
|
||||
) -> bool:
|
||||
"""
|
||||
True = zapnout MI export cut-off (reg 178 bits 0–1 = 11b).
|
||||
|
||||
Plán může mít z_gen_cutoff=0 (PV B jen do domu v LP), ale bez cut-off na GEN portu
|
||||
mikroinvertory fyzicky exportují do sítě — při export_ban (záporná vykupní, grid≥0)
|
||||
cut-off vynutit i bez solver flagu.
|
||||
"""
|
||||
if not gen_microinverter_cutoff_enabled:
|
||||
return False
|
||||
if deye_mode == "SELL":
|
||||
return False
|
||||
return bool(deye_gen_cutoff_enabled) or bool(export_ban)
|
||||
|
||||
|
||||
def deye_reg_triggers_self_sustain_after_verify_exhaust(reg: int) -> bool:
|
||||
"""True = po 3x mismatch přepnout lokalitu do SELF_SUSTAIN (kritický registr)."""
|
||||
return int(reg) in DEYE_CRITICAL_REGS_SELF_SUSTAIN
|
||||
|
||||
Reference in New Issue
Block a user