|
20 | 20 | from threading import Thread, Event |
21 | 21 | import traceback |
22 | 22 | from typing import Dict, Optional, Tuple |
| 23 | +from fnmatch import fnmatch |
23 | 24 |
|
24 | 25 | from control.algorithm.utils import get_medium_charging_current |
25 | 26 | from control.chargelog import chargelog |
@@ -154,11 +155,18 @@ def _is_autolock_inactive(self) -> Tuple[bool, Optional[str]]: |
154 | 155 | def _is_manual_lock_inactive(self) -> Tuple[bool, Optional[str]]: |
155 | 156 | # Die Pro schickt je nach Timing auch nach Abstecken noch ein paar Zyklen den Tag. Dann darf der Ladepunkt |
156 | 157 | # nicht wieder entsperrt werden. |
157 | | - if (self.data.get.rfid or |
158 | | - self.data.get.vehicle_id or |
159 | | - self.data.set.rfid) in self.template.data.valid_tags: |
160 | | - Pub().pub(f"openWB/set/chargepoint/{self.num}/set/manual_lock", False) |
161 | | - elif self.template.data.disable_after_unplug and self.data.get.plug_state is False: |
| 158 | + |
| 159 | + # Prüfung auf ein passendes Muster |
| 160 | + # Vergleiche werden case-insensitive durchgeführt |
| 161 | + # das vereinfacht die Eingabe, kann aber auch für falsche Treffer sorgen. |
| 162 | + # 'fnmatch()' ist case-insensitive |
| 163 | + for tag_id in self.template.data.valid_tags: |
| 164 | + if ((self.data.get.rfid is not None and fnmatch(self.data.get.rfid, tag_id)) or |
| 165 | + (self.data.get.vehicle_id is not None and fnmatch(self.data.get.vehicle_id, tag_id)) or |
| 166 | + (self.data.set.rfid is not None and fnmatch(self.data.set.rfid, tag_id))): |
| 167 | + Pub().pub(f"openWB/svet/chargepoint/{self.num}/set/manual_lock", False) |
| 168 | + # Wenn der Ladepunkt nach dem Abstecken gesperrt werden soll, und kein Fahrzeug angeschlossen ist wird gesperrt |
| 169 | + if self.template.data.disable_after_unplug and self.data.get.plug_state is False: |
162 | 170 | Pub().pub(f"openWB/set/chargepoint/{self.num}/set/manual_lock", True) |
163 | 171 |
|
164 | 172 | if self.data.set.manual_lock: |
|
0 commit comments