Skip to content

Commit 151d101

Browse files
authored
Merge pull request #3047 from LKuemmel/beta-merge
Merge master into Beta
2 parents ad43ba4 + f962065 commit 151d101

File tree

994 files changed

+16539
-4680
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

994 files changed

+16539
-4680
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ charset = utf-8
66
end_of_line = lf
77
insert_final_newline = true
88

9+
[simpleAPI/**.php]
10+
indent_style = space
11+
indent_size = 4
12+
913
[*.{py,yml,lock}]
1014
indent_style = space
1115
indent_size = 4

.github/workflows/publish_docs_to_wiki.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ on:
99
- master # This can be changed to any branch of your preference
1010

1111
env:
12-
USER_TOKEN: ${{ secrets.WIKI_ACTION_TOKEN }} # This is the repository secret
13-
USER_NAME: LKuemmel # Enter the username of your (bot) account
14-
USER_EMAIL: lena.kuemmel@openwb.de # Enter the e-mail of your (bot) account
12+
WIKI_TOKEN: ${{ secrets.WIKI_ACTION_TOKEN }} # Personal Access Token with repo scope
13+
USER_NAME: "GitHub Actions" # Enter the username of your (bot) account
14+
USER_EMAIL: "actions@github.com" # Enter the e-mail of your (bot) account
1515
OWNER: ${{ github.event.repository.owner.name }} # This is the repository owner
1616
REPOSITORY_NAME: ${{ github.event.repository.name }} # This is the repository name
1717

@@ -31,15 +31,15 @@ jobs:
3131
mkdir tmp_wiki
3232
cd tmp_wiki
3333
git init
34-
git config user.name $USER_NAME
35-
git config user.email $USER_EMAIL
36-
git pull https://$USER_TOKEN@github.com/$OWNER/$REPOSITORY_NAME.wiki.git
34+
git pull https://$WIKI_TOKEN@github.com/$OWNER/$REPOSITORY_NAME.wiki.git
3735
# 4. Synchronize differences between `docs` & `tmp_wiki`
3836
# 5. Push new Wiki content
3937
- name: Push content to wiki
4038
run: |
4139
rsync -av --delete docs/ tmp_wiki/ --exclude .git
4240
cd tmp_wiki
41+
git config user.name "$USER_NAME"
42+
git config user.email "$USER_EMAIL"
4343
git add .
44-
git commit -m "Update Wiki content"
45-
git push -f --set-upstream https://$USER_TOKEN@github.com/$OWNER/$REPOSITORY_NAME.wiki.git master
44+
git commit -m "Update Wiki content" || echo "No changes to commit"
45+
git push -f --set-upstream https://$WIKI_TOKEN@github.com/$OWNER/$REPOSITORY_NAME.wiki.git master

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
.vscode/*
1111
__pycache__/
1212
node_modules/
13+
data/config/eebus/certs/*
1314
data/log/*
1415
data/charge_log/*
1516
data/daily_log/*
1617
data/monthly_log/*
1718
data/backup/*.tar.gz
19+
data/backup/*.openwb-backup*
1820
data/restore/*.tar.gz
1921
data/data_migration/*.tar.gz
2022
ramdisk/*

data/config/mosquitto/mosquitto.acl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# openwb-version:2
1+
# openwb-version:3
22
# allow publishing set topics
33
topic write openWB/set/#
44
# allow clearing system messages
@@ -11,3 +11,5 @@ topic read openWB/#
1111
topic read openWB-remote/#
1212
# allow brach "others" for devices other than openWB
1313
topic readwrite others/#
14+
# allow read write access for simpleAPI
15+
topic readwrite openWB/simpleAPI/#
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# openwb-version:1
2+
[Unit]
3+
Description="openWB mqtt simpleAPI"
4+
After=mosquitto.service
5+
6+
[Service]
7+
User=openwb
8+
WorkingDirectory=/var/www/html/openWB
9+
ExecStart=/var/www/html/openWB/simpleAPI/simpleAPI_mqtt.py
10+
Restart=always
11+
# extend timeout to 15min for long running atreboot
12+
TimeoutStartSec=900
13+
14+
[Install]
15+
WantedBy=multi-user.target
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"host": "localhost",
3+
"port": 1883,
4+
"username": null,
5+
"password": null,
6+
"use_tls": false,
7+
"qos": 0,
8+
"retain": true,
9+
"reconnect_delay": 10,
10+
"log_level": "INFO"
11+
}

docs/IO-Geräte & -Aktionen.md

Lines changed: 0 additions & 39 deletions
This file was deleted.

docs/Identifikation.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

docs/Neues Modul programmieren.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,37 @@ Bei manchen Fahrzeugen kann der SoC nicht während der Ladung abgefragt werden.
4444

4545
Nach dreimaliger fehlgeschlagener Abfrage wird der SoC auf 0% gesetzt, damit in jedem Fall geladen wird.
4646

47-
_Bei Fragen programmiert Ihr das SoC-Modul vorerst, wie Ihr es versteht, und erstellt einen (Draft-)PR. Wir unterstützen Euch gerne per Review.
47+
_Bei Fragen programmiert Ihr das SoC-Modul vorerst, wie Ihr es versteht, und erstellt einen (Draft-)PR. Wir unterstützen Euch gerne per Review._
48+
49+
### Breaking Changes und Ergänzen von neuen Einstellungen
50+
51+
Die Klasse `UpdateConfig` verwaltet automatische Migrationen bei Breaking Changes und neuen Einstellungen. Das System funktioniert folgendermaßen:
52+
- Für jede notwendige Anpassung wird eine nummerierte Upgrade-Funktion erstellt.
53+
- Beim Systemstart werden alle noch nicht ausgeführten Upgrade-Funktionen automatisch aufgerufen
54+
- Die Nummern der bereits ausgeführten Funktionen werden persistent gespeichert, um mehrfache Ausführung zu verhindern. Der aktuelle Migrations-Status wird im MQTT-Topic `openWB/system/datastore_version` veröffentlicht.
55+
56+
Alle Upgrade-Funktionen folgen einem einheitlichen Schema:
57+
```python
58+
def upgrade_datastore_104(self) -> None:
59+
"""Upgrade-Funktion für Datastore-Version 104: Ergänzt fehlende aWATTar-Konfigurationsparameter"""
60+
def upgrade(topic: str, payload) -> None:
61+
"""Prüft und migriert ein einzelnes MQTT-Topic"""
62+
# Topic finden, das aktualisiert werden soll
63+
if "openWB/optional/ep/flexible_tariff/provider" == topic:
64+
provider = decode_payload(payload)
65+
# Nur für aWATTar-Provider ausführen
66+
if provider["type"] == "awattar":
67+
# Prüfen, ob das "net"-Feld fehlt (neue Konfiguration)
68+
if provider["configuration"].get("net") is None:
69+
# Standardwerte für fehlende Konfigurationsparameter setzen
70+
provider["configuration"]["net"] = False
71+
provider["configuration"]["fix"] = 0.015
72+
provider["configuration"]["proportional"] = 0.03
73+
provider["configuration"]["tax"] = 0.2
74+
# Aktualisierte Konfiguration zurückgeben
75+
return {topic: provider}
76+
# Alle gespeicherten MQTT-Topics durchlaufen und Upgrade-Funktion anwenden
77+
self._loop_all_received_topics(upgrade)
78+
# Diese Upgrade-Funktion als ausgeführt markieren (Version 104)
79+
self._append_datastore_version(104)
80+
```

docs/Steuerbare Verbrauchseinrichtungen nach §14a.md

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)