adding user for dov

This commit is contained in:
2025-09-25 21:00:42 -04:00
parent 879885dc3b
commit 28cd7f3f6f
6 changed files with 553 additions and 0 deletions

19
dc_charger.py Normal file
View File

@@ -0,0 +1,19 @@
def dc_charger_on(
battery_max_kwh: float,
battery_current_kwh: float,
solar_max_kwh: float,
daily_power_kwh: float,
night: bool,
) -> bool:
battery_free_kwh = battery_max_kwh - battery_current_kwh
if daily_power_kwh <= battery_current_kwh or night:
return True
if battery_current_kwh >= battery_max_kwh:
return False
if solar_max_kwh >= battery_free_kwh:
return False
return True