Skip to content

Commit ffab03f

Browse files
authored
Merge branch 'master' into energy-flow-speed
2 parents 2fb555a + 7421719 commit ffab03f

File tree

293 files changed

+409
-391
lines changed

Some content is hidden

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

293 files changed

+409
-391
lines changed

packages/control/chargelog/chargelog.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from enum import Enum
33
import json
44
import logging
5+
import os
56
import pathlib
67
from typing import Any, Dict, List, Optional
78

@@ -250,13 +251,18 @@ def write_new_entry(new_entry):
250251
filepath = str(_get_parent_file() / "data" / "charge_log" /
251252
(timecheck.create_timestamp_YYYYMM() + ".json"))
252253
try:
253-
with open(filepath, "r", encoding="utf-8") as json_file:
254-
content = json.load(json_file)
254+
if os.path.exists(filepath) and os.path.getsize(filepath) == 0:
255+
content = []
256+
else:
257+
with open(filepath, "r", encoding="utf-8") as json_file:
258+
try:
259+
content = json.load(json_file)
260+
except json.decoder.JSONDecodeError:
261+
corrupt_path = f"{filepath}.unparsable_{timecheck.create_timestamp()}"
262+
os.rename(filepath, corrupt_path)
263+
log.error(f"ChargeLog: Korrupte Datei umbenannt nach {corrupt_path}")
264+
content = []
255265
except FileNotFoundError:
256-
# with open(filepath, "w", encoding="utf-8") as jsonFile:
257-
# json.dump([], jsonFile)
258-
# with open(filepath, "r", encoding="utf-8") as jsonFile:
259-
# content = json.load(jsonFile)
260266
content = []
261267
content.append(new_entry)
262268
write_and_check(filepath, content)

packages/control/chargepoint/chargepoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def _is_phase_switch_required(self) -> bool:
376376
self.check_deviating_contactor_states(self.data.set.phases_to_use,
377377
self.data.control_parameter.phases)) and
378378
# Wenn der Ladevorgang gestartet wird, muss vor dem ersten Laden umgeschaltet werden.
379-
self.data.get.charge_state is False):
379+
self.data.set.current != 0 and self.data.get.charge_state is False):
380380
phase_switch_required = True
381381
if phase_switch_required:
382382
# Umschaltung fehlgeschlagen

packages/control/ev/ev.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,13 @@ def auto_phase_switch(self,
353353
waiting_time,
354354
delay)[1])
355355
control_parameter.state = ChargepointState.PHASE_SWITCH_DELAY
356-
elif condition_msg:
357-
if condition_msg == self.CURRENT_OUT_OF_NOMINAL_DIFFERENCE:
358-
message = f"Keine Phasenumschaltung{condition_msg}"
359-
else:
360-
log.debug(f"Keine Phasenumschaltung{condition_msg}")
356+
else:
357+
if condition_msg:
358+
if condition_msg == self.CURRENT_OUT_OF_NOMINAL_DIFFERENCE:
359+
message = f"Keine Phasenumschaltung{condition_msg}"
360+
else:
361+
log.debug(f"Keine Phasenumschaltung{condition_msg}")
362+
control_parameter.timestamp_phase_switch_buffer_start = None
361363
else:
362364
if condition:
363365
# Timer laufen lassen
@@ -379,6 +381,7 @@ def auto_phase_switch(self,
379381
).data.set.reserved_surplus -= max(0, required_reserved_power)
380382
message = f"Verzögerung für die {direction_str} Phasen abgebrochen{condition_msg}"
381383
control_parameter.state = ChargepointState.CHARGING_ALLOWED
384+
control_parameter.timestamp_phase_switch_buffer_start = None
382385

383386
if message:
384387
log.info(f"LP {cp_num}: {message}")

packages/main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@ def handler_midnight(self):
233233

234234
@__with_handler_lock(error_threshold=60)
235235
def handler_random_nightly(self):
236+
log.warning("Display wird neu geladen.") # nur zur Info im Log
237+
# chromium neu starten, um größere Auswirkungen eines Speicherlecks zu vermeiden
238+
run_command.run_command([
239+
str(Path(__file__).resolve().parents[1] / "runs" / "update_local_display.sh"), "1"
240+
], process_exception=True)
236241
try:
237242
data.data.system_data["system"].thread_backup_and_send_to_cloud()
238243
except Exception:

packages/modules/web_themes/koala/source/src/components/BatteryCard.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@
77
'full-height': props.fullHeight,
88
}"
99
>
10-
<q-card-section class="row items-center justify-between">
10+
<q-card-section class="row no-wrap items-center justify-between">
1111
<div class="text-h6 text-bold ellipsis" :title="cardTitle">
1212
{{ cardTitle }}
1313
</div>
14-
<q-icon
15-
class="cursor-pointer q-ml-auto"
14+
<q-space />
15+
<q-btn
1616
v-if="showSettings"
17-
name="settings"
18-
size="sm"
17+
icon="settings"
18+
flat
19+
round
20+
dense
1921
@click="dialog?.open()"
2022
/>
2123
</q-card-section>

packages/modules/web_themes/koala/source/src/components/ChargePointInformation.vue

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,34 @@
2323
@row-click="onRowClick"
2424
>
2525
<!-- full view table body slots -->
26+
<template #body-cell-name="slotProps">
27+
<q-td :class="[`text-${slotProps.col.align}`, 'max-width-0']">
28+
<div class="ellipsis" :title="slotProps.row.name">
29+
{{ slotProps.row.name }}
30+
</div>
31+
</q-td>
32+
</template>
33+
<template #body-cell-vehicle="slotProps">
34+
<q-td :class="[`text-${slotProps.col.align}`, 'max-width-0']">
35+
<div class="ellipsis" :title="slotProps.row.vehicle">
36+
{{ slotProps.row.vehicle }}
37+
</div>
38+
</q-td>
39+
</template>
2640
<template #body-cell-plugged="slotProps">
27-
<q-td :class="`text-${slotProps.col.align}`">
41+
<q-td auto-width :class="`text-${slotProps.col.align}`">
2842
<ChargePointStateIcon :charge-point-id="slotProps.row.id" />
2943
</q-td>
3044
</template>
3145

3246
<template #body-cell-chargeMode="slotProps">
33-
<q-td :class="`text-${slotProps.col.align}`">
47+
<q-td auto-width :class="`text-${slotProps.col.align}`">
3448
<ChargePointMode :charge-point-id="slotProps.row.id" />
3549
</q-td>
3650
</template>
3751

3852
<template #body-cell-timeCharging="slotProps">
39-
<q-td :class="`text-${slotProps.col.align}`">
53+
<q-td auto-width :class="`text-${slotProps.col.align}`">
4054
<ChargePointTimeCharging
4155
:charge-point-id="slotProps.row.id"
4256
:readonly="true"
@@ -47,7 +61,7 @@
4761
</template>
4862

4963
<template #body-cell-powerColumn="slotProps">
50-
<q-td :class="`text-${slotProps.col.align}`">
64+
<q-td auto-width :class="`text-${slotProps.col.align}`">
5165
<ChargePointPowerData
5266
:power="slotProps.row.power"
5367
:phase-number="slotProps.row.phaseNumber"
@@ -56,18 +70,32 @@
5670
/>
5771
</q-td>
5872
</template>
73+
<template #body-cell-charged="slotProps">
74+
<q-td auto-width :class="`text-${slotProps.col.align}`">
75+
{{ slotProps.row.charged }}
76+
</q-td>
77+
</template>
78+
<template #body-cell-soc="slotProps">
79+
<q-td auto-width :class="`text-${slotProps.col.align}`">
80+
{{ slotProps.row.soc }}
81+
</q-td>
82+
</template>
5983
<!-- compact view table body slots -->
6084
<!-- compact view charge point name and vehicle name displayed in one field -->
6185
<template #body-cell-nameAndVehicle="slotProps">
62-
<q-td :class="`text-${slotProps.col.align}`">
63-
{{ slotProps.row.name }}<br />
64-
<span class="text-caption">{{ slotProps.row.vehicle }}</span>
86+
<q-td :class="[`text-${slotProps.col.align}`, 'max-width-0']">
87+
<div class="ellipsis" :title="slotProps.row.name">
88+
{{ slotProps.row.name }}
89+
</div>
90+
<div class="ellipsis text-caption" :title="slotProps.row.vehicle">
91+
{{ slotProps.row.vehicle }}
92+
</div>
6593
</q-td>
6694
</template>
6795

6896
<!-- compact view charge point charge mode, plug status and time charging displayed in one field -->
6997
<template #body-cell-modePluggedTimeCharging="slotProps">
70-
<q-td :class="`text-${slotProps.col.align}`">
98+
<q-td auto-width :class="`text-${slotProps.col.align}`">
7199
<div class="items-center">
72100
<ChargePointMode :charge-point-id="slotProps.row.id" />
73101
<ChargePointStateIcon :charge-point-id="slotProps.row.id" />
@@ -228,3 +256,9 @@ const onRowClick = (row: ChargePointRow) => {
228256
modalChargePointCardVisible.value = true;
229257
};
230258
</script>
259+
260+
<style scoped lang="scss">
261+
.max-width-0 {
262+
max-width: 0;
263+
}
264+
</style>

packages/modules/web_themes/koala/source/src/components/ChargePointPowerData.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div
33
:class="[
44
'text-no-wrap items-center',
5-
columnDisplayFormat ? 'column' : 'row inline',
5+
columnDisplayFormat ? 'column' : 'row inline no-wrap',
66
]"
77
>
88
<span>{{ power }}</span>

packages/modules/web_themes/koala/source/src/components/ChargePointPvSettings.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<template>
22
<SliderStandard
33
title="Minimaler Dauerstrom"
4-
:min="-1"
4+
:min="0"
55
:max="16"
66
:step="1"
77
unit="A"
8-
:off-value-left="-1"
9-
:discrete-values="[-1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]"
8+
:off-value-left="0"
9+
:discrete-values="[0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]"
1010
v-model="pvMinCurrent.value"
1111
class="q-mt-md"
1212
/>

packages/modules/web_themes/koala/source/src/components/VehicleCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class="card-width"
55
:class="{ 'full-height': props.fullHeight }"
66
>
7-
<q-card-section class="row">
7+
<q-card-section class="row no-wrap">
88
<div class="text-h6 text-bold ellipsis" :title="vehicle?.name">
99
{{ vehicle?.name }}
1010
</div>

packages/modules/web_themes/koala/source/src/components/VehicleInformation.vue

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,35 @@
2323
@row-click="onRowClick"
2424
>
2525
<!-- "col" = column must match Quasar naming convention -->
26+
<template #row-expand="slotProps">
27+
<VehicleConnectionStateIcon :vehicle-id="slotProps.row.id" />
28+
</template>
29+
<template #body-cell-name="slotProps">
30+
<q-td :class="[`text-${slotProps.col.align}`, 'max-width-0']">
31+
<div class="ellipsis" :title="slotProps.row.name">
32+
{{ slotProps.row.name }}
33+
</div>
34+
</q-td>
35+
</template>
36+
<template #body-cell-manufacturer="slotProps">
37+
<q-td auto-width :class="`text-${slotProps.col.align}`">
38+
{{ slotProps.row.manufacturer }}
39+
</q-td>
40+
</template>
41+
<template #body-cell-model="slotProps">
42+
<q-td auto-width :class="`text-${slotProps.col.align}`">
43+
{{ slotProps.row.model }}
44+
</q-td>
45+
</template>
2646
<template #body-cell-plugged="slotProps">
27-
<q-td :class="`text-${slotProps.col.align}`">
47+
<q-td auto-width :class="`text-${slotProps.col.align}`">
2848
<ChargePointStateIcon :vehicle-id="slotProps.row.id" />
2949
</q-td>
3050
</template>
31-
<template #row-expand="slotProps">
32-
<VehicleConnectionStateIcon :vehicle-id="slotProps.row.id" />
51+
<template #body-cell-vehicleSocValue="slotProps">
52+
<q-td auto-width :class="`text-${slotProps.col.align}`">
53+
{{ slotProps.row.vehicleSocValue }}
54+
</q-td>
3355
</template>
3456
</BaseTable>
3557

@@ -119,3 +141,9 @@ const onRowClick = (row: VehicleRow) => {
119141
modalChargeVehicleCardVisible.value = true;
120142
};
121143
</script>
144+
145+
<style scoped lang="scss">
146+
.max-width-0 {
147+
max-width: 0;
148+
}
149+
</style>

0 commit comments

Comments
 (0)