Skip to content

Commit

Permalink
Apply isort and ruff code style
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelosthege authored and drbacke committed Oct 3, 2024
1 parent 59a696c commit 41efea2
Show file tree
Hide file tree
Showing 23 changed files with 1,792 additions and 871 deletions.
6 changes: 3 additions & 3 deletions README-DE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Die Diskussion findet im [Forum](https://www.akkudoktor.net/forum/diy-energie-op

## Installation

Gute Install Anleitung:
Gute Install Anleitung:
https://meintechblog.de/2024/09/05/andreas-schmitz-joerg-installiert-mein-energieoptimierungssystem/

Das Projekt erfordert Python 3.8 oder neuer.
Expand Down Expand Up @@ -115,7 +115,7 @@ Beschreibt die Struktur und Datentypen des JSON-Objekts, das an den Flask-Server
- **Beschreibung**: Ein Array von Floats, das den Strompreis in Euro pro Wattstunde für verschiedene Zeitintervalle darstellt.
- **Typ**: Array
- **Element-Typ**: Float
- **Länge**: 48
- **Länge**: 48

### gesamtlast
- **Beschreibung**: Ein Array von Floats, das die Gesamtlast (Verbrauch) in Watt für verschiedene Zeitintervalle darstellt.
Expand All @@ -136,7 +136,7 @@ Beschreibt die Struktur und Datentypen des JSON-Objekts, das an den Flask-Server
- **Länge**: 48

### pv_soc
- **Beschreibung**: Ein Integer, der den Ladezustand des PV Akkus zum START der aktuellen Stunde anzeigt, das ist nicht der aktuelle!!!
- **Beschreibung**: Ein Integer, der den Ladezustand des PV Akkus zum START der aktuellen Stunde anzeigt, das ist nicht der aktuelle!!!
- **Typ**: Integer

### pv_akku_cap
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The discussion takes place in the [forum](https://www.akkudoktor.net/forum/diy-e

## Installation

Good installation guide:
Good installation guide:
https://meintechblog.de/2024/09/05/andreas-schmitz-joerg-installiert-mein-energieoptimierungssystem/

The project requires Python 3.8 or newer.
Expand Down Expand Up @@ -110,7 +110,7 @@ Describes the structure and data types of the JSON object sent to the Flask serv
- **Description**: An array of floats representing the electricity price in euros per watt-hour for different time intervals.
- **Type**: Array
- **Element Type**: Float
- **Length**: 48
- **Length**: 48

### `gesamtlast`
- **Description**: An array of floats representing the total load (consumption) in watts for different time intervals.
Expand Down Expand Up @@ -214,4 +214,4 @@ This object contains the results of the simulation and provides insights into va
- **Netzbezug_Wh_pro_Stunde**: The grid energy drawn in watt-hours per hour.
- **Netzeinspeisung_Wh_pro_Stunde**: The energy fed into the grid in watt-hours per hour.
- **Verluste_Pro_Stunde**: The losses in watt-hours per hour.
- **akku_soc_pro_stunde**: The state of charge of the battery (not the EV) in percentage per hour.
- **akku_soc_pro_stunde**: The state of charge of the battery (not the EV) in percentage per hour.
54 changes: 32 additions & 22 deletions config.example.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
from datetime import datetime, timedelta


prediction_hours=48
optimization_hours=24
strafe=10
moegliche_ladestroeme_in_prozent = [0.0 ,6.0/16.0, 7.0/16.0, 8.0/16.0, 9.0/16.0, 10.0/16.0, 11.0/16.0, 12.0/16.0, 13.0/16.0, 14.0/16.0, 15.0/16.0, 1.0 ]
prediction_hours = 48
optimization_hours = 24
strafe = 10
moegliche_ladestroeme_in_prozent = [
0.0,
6.0 / 16.0,
7.0 / 16.0,
8.0 / 16.0,
9.0 / 16.0,
10.0 / 16.0,
11.0 / 16.0,
12.0 / 16.0,
13.0 / 16.0,
14.0 / 16.0,
15.0 / 16.0,
1.0,
]


# Optional
db_config = {
'user': 'eos',
'password': 'eos',
'host': '127.0.0.1',
'database': 'eos'
}
db_config = {"user": "eos", "password": "eos", "host": "127.0.0.1", "database": "eos"}


def get_start_enddate(prediction_hours=48,startdate=None):
############
# Parameter
############
if startdate == None:
date = (datetime.now().date() + timedelta(hours = prediction_hours)).strftime("%Y-%m-%d")
date_now = datetime.now().strftime("%Y-%m-%d")
else:
date = (startdate + timedelta(hours = prediction_hours)).strftime("%Y-%m-%d")
date_now = startdate.strftime("%Y-%m-%d")
return date_now,date
def get_start_enddate(prediction_hours=48, startdate=None):
############
# Parameter
############
if startdate == None:
date = (datetime.now().date() + timedelta(hours=prediction_hours)).strftime(
"%Y-%m-%d"
)
date_now = datetime.now().strftime("%Y-%m-%d")
else:
date = (startdate + timedelta(hours=prediction_hours)).strftime("%Y-%m-%d")
date_now = startdate.strftime("%Y-%m-%d")
return date_now, date
Loading

0 comments on commit 41efea2

Please sign in to comment.