Branch 4: BA81 GEN cutoff audit + exekuce při sell<0
Some checks failed
CI and deploy / migration-check (push) Failing after 14s
CI and deploy / deploy (push) Has been skipped

This commit is contained in:
Dusan Vojacek
2026-06-06 22:36:27 +02:00
parent a7879f1141
commit 0f7dc6ed94
11 changed files with 99 additions and 4 deletions

View File

@@ -24,6 +24,7 @@ from services.control.deye_helpers import (
REG178_VERIFY_MASK_COMBINED,
_DEYE_INACTIVE_TOU_REGISTERS,
_deye_should_skip_time_sync_after_read,
deye_mi_export_cutoff_want_enabled,
_prague_minute_start_utc,
current_slot_hhmm,
next_slot_hhmm,
@@ -194,7 +195,12 @@ async def write_inverter_setpoints(
current_178 = int(r178[0])
peak_bits = int(reg178_val) & int(REG178_VERIFY_MASK)
if inv.deye_gen_microinverter_cutoff_enabled:
want_cutoff = bool(setpoints_now.deye_gen_cutoff_enabled) and deye_mode != "SELL"
want_cutoff = deye_mi_export_cutoff_want_enabled(
gen_microinverter_cutoff_enabled=True,
deye_gen_cutoff_enabled=bool(setpoints_now.deye_gen_cutoff_enabled),
export_ban=bool(setpoints_now.export_ban),
deye_mode=deye_mode,
)
mi_bits = REG178_MI_EXPORT_ENABLE if want_cutoff else REG178_MI_EXPORT_DISABLE
else:
mi_bits = int(current_178) & int(REG178_MI_EXPORT_MASK)