Skip to content

Commit 2fc10e0

Browse files
authored
Merge branch 'openWB:main' into UPower
2 parents fbd5273 + cac502c commit 2fc10e0

33 files changed

+1076
-1262
lines changed

package-lock.json

+181-181
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"vue-axios": "^3.5.2",
4242
"vue-chartjs": "^5.3.2",
4343
"vue-router": "^4.5.0",
44-
"vue3-table-lite": "^1.4.2",
44+
"vue3-table-lite": "^1.4.3",
4545
"vuedraggable": "^4.1.0",
4646
"vuex": "^4.1.0"
4747
},
@@ -61,6 +61,6 @@
6161
"rollup-plugin-node-polyfills": "^0.2.1",
6262
"vite": "^4.5.9",
6363
"vite-plugin-node-polyfills": "^0.9.0",
64-
"vitest": "^1.6.0"
64+
"vitest": "^1.6.1"
6565
}
6666
}

src/components/backup_clouds/OpenwbBackupCloudProxy.vue

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<openwb-base-heading> Einstellungen für Backup-Cloud Modul "{{ backupCloud.name }}" </openwb-base-heading>
33
<component
4-
:is="myComponent"
4+
:is="getBackupCloudComponent()"
55
:backup-cloud="backupCloud"
66
@update:configuration="updateConfiguration($event)"
77
@send-command="sendCommand($event)"
@@ -18,16 +18,14 @@ export default {
1818
backupCloud: { type: Object, required: true },
1919
},
2020
emits: ["update:configuration", "sendCommand"],
21-
computed: {
22-
myComponent() {
23-
console.debug(`loading backup cloud: ${this.backupCloud.name} (${this.backupCloud.type})`);
21+
methods: {
22+
getBackupCloudComponent() {
23+
console.debug(`loading backup cloud: ${this.backupCloud.type}`);
2424
return defineAsyncComponent({
2525
loader: () => import(`./${this.backupCloud.type}/backup_cloud.vue`),
2626
errorComponent: OpenwbBackupCloudFallback,
2727
});
2828
},
29-
},
30-
methods: {
3129
// event pass through
3230
updateConfiguration(event) {
3331
this.$emit("update:configuration", event);

src/components/charge_points/OpenwbChargePointProxy.vue

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<template>
22
<openwb-base-heading> Einstellungen für Ladepunkt Typ "{{ chargePoint.type }}" </openwb-base-heading>
33
<component
4-
:is="myChargePointSettingsComponent"
4+
:is="getChargePointSettingsComponent()"
55
:charge-point="chargePoint"
66
@update:configuration="updateConfiguration($event)"
77
/>
88
<hr />
99
<openwb-base-heading> Befehle für Ladepunkt Typ "{{ chargePoint.type }}" </openwb-base-heading>
1010
<component
11-
:is="myChargePointCommandsComponent"
11+
:is="getChargePointCommandsComponent()"
1212
:charge-point="chargePoint"
1313
/>
1414
</template>
@@ -24,23 +24,21 @@ export default {
2424
chargePoint: { required: true, type: Object },
2525
},
2626
emits: ["update:configuration"],
27-
computed: {
28-
myChargePointSettingsComponent() {
29-
console.debug(`loading charge point settings: ${this.chargePoint.name} (${this.chargePoint.type})`);
27+
methods: {
28+
getChargePointSettingsComponent() {
29+
console.debug(`loading charge point settings: ${this.chargePoint.type}`);
3030
return defineAsyncComponent({
3131
loader: () => import(`./${this.chargePoint.type}/chargePoint.vue`),
3232
errorComponent: OpenwbChargePointConfigFallback,
3333
});
3434
},
35-
myChargePointCommandsComponent() {
36-
console.debug(`loading charge point commands: ${this.chargePoint.name} (${this.chargePoint.type})`);
35+
getChargePointCommandsComponent() {
36+
console.debug(`loading charge point commands: ${this.chargePoint.type}`);
3737
return defineAsyncComponent({
3838
loader: () => import(`./${this.chargePoint.type}/commands.vue`),
3939
errorComponent: OpenwbChargePointCommandsFallback,
4040
});
4141
},
42-
},
43-
methods: {
4442
updateConfiguration(event) {
4543
this.$emit("update:configuration", event);
4644
},

src/components/devices/OpenwbConfigProxy.vue

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<component
3-
:is="myComponent"
3+
:is="getComponent()"
44
:device="device"
55
:component="component"
66
:configuration="component ? component.configuration : device.configuration"
@@ -24,11 +24,9 @@ export default {
2424
component: { type: Object, required: false, default: undefined },
2525
},
2626
emits: ["update:configuration"],
27-
computed: {
28-
myComponent() {
29-
console.debug(
30-
`loading component: ${this.device.name} (${this.device.type}) / ${this.component?.name} (${this.component?.type})`,
31-
);
27+
methods: {
28+
getComponent() {
29+
console.debug(`loading component: ${this.device.type} / ${this.component?.type}`);
3230
if (this.component !== undefined) {
3331
return defineAsyncComponent({
3432
loader: () => import(`./${this.device.vendor}/${this.device.type}/${this.component.type}.vue`),
@@ -41,8 +39,6 @@ export default {
4139
});
4240
}
4341
},
44-
},
45-
methods: {
4642
updateConfiguration(event) {
4743
this.$emit("update:configuration", event);
4844
},

src/components/devices/tesla/tesla/device.vue

+15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
<template>
22
<div class="device-tesla">
33
<openwb-base-heading> Einstellungen für Tesla </openwb-base-heading>
4+
<openwb-base-alert subtype="danger">
5+
<span style="font-weight: bold">
6+
Tesla hat in der aktuellen Firmware-Version die lokale API der PowerWall abgeschaltet. </span
7+
>Daher ist es mit dieser Firmware nicht mehr möglich, die PowerWall direkt auszulesen. Wir prüfen aktuell den
8+
Zugriff über die Tesla-Server. Bis zur Umsetzung dieser Funktion ist es nicht möglich, die PowerWall lokal
9+
auszulesen.<br />
10+
<span style="font-weight: bold">
11+
Wenn die lokale Abfrage bei Dir noch funktioniert, dann solltest Du die Firmware der PowerWall nicht
12+
aktualisieren! </span
13+
><br />
14+
Wir empfehlen, dass Du Tesla kontaktierst und Kritik an dieser Entscheidung mitteilst. Nur so können wir hoffen,
15+
dass Tesla die lokale API wieder aktiviert. Mit der Cloud-API kommt es zwangsläufig zu Verzögerungen (Latenzen),
16+
welche eine Regelung durch openWB erschweren. Weiterhin kommt es zu einem totalen Ausfall, wenn die
17+
Internetverbindung gestört ist. Aus diesen Gründen ist eine lokale API immer vorzuziehen.
18+
</openwb-base-alert>
419
<openwb-base-text-input
520
title="IP oder Hostname"
621
subtype="host"

src/components/display_themes/OpenwbDisplayThemeProxy.vue

+4-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</openwb-base-alert>
2323
<openwb-base-heading> Einstellungen für Display Theme "{{ displayTheme.name }}" </openwb-base-heading>
2424
<component
25-
:is="myComponent"
25+
:is="getDisplayThemeComponent()"
2626
:display-theme="displayTheme"
2727
@update:configuration="updateConfiguration($event)"
2828
/>
@@ -47,16 +47,14 @@ export default {
4747
displayTheme: { type: Object, required: true },
4848
},
4949
emits: ["update:configuration"],
50-
computed: {
51-
myComponent() {
52-
console.debug(`loading display theme: ${this.displayTheme.name} (${this.displayTheme.type})`);
50+
methods: {
51+
getDisplayThemeComponent() {
52+
console.debug(`loading display theme: ${this.displayTheme.type}`);
5353
return defineAsyncComponent({
5454
loader: () => import(`./${this.displayTheme.type}/displayTheme.vue`),
5555
errorComponent: OpenwbDisplayThemeFallback,
5656
});
5757
},
58-
},
59-
methods: {
6058
updateConfiguration(event) {
6159
this.$emit("update:configuration", event);
6260
},

src/components/electricity_tariffs/OpenwbElectricityTariffProxy.vue

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<openwb-base-heading> Einstellungen für Modul "{{ electricityTariff.name }}" </openwb-base-heading>
33
<component
4-
:is="myComponent"
4+
:is="getTariffComponent()"
55
:electricity-tariff="electricityTariff"
66
@update:configuration="updateConfiguration($event)"
77
/>
@@ -17,16 +17,14 @@ export default {
1717
electricityTariff: { type: Object, required: true },
1818
},
1919
emits: ["update:configuration"],
20-
computed: {
21-
myComponent() {
22-
console.debug(`loading electricity tariff: ${this.electricityTariff.name} (${this.electricityTariff.type})`);
20+
methods: {
21+
getTariffComponent() {
22+
console.debug(`loading electricity tariff: ${this.electricityTariff.type}`);
2323
return defineAsyncComponent({
2424
loader: () => import(`./${this.electricityTariff.type}/electricity_tariff.vue`),
2525
errorComponent: OpenwbElectricityTariffFallback,
2626
});
2727
},
28-
},
29-
methods: {
3028
updateConfiguration(event) {
3129
this.$emit("update:configuration", event);
3230
},

src/components/mixins/ComponentState.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default {
5353
});
5454
},
5555
ac_current2dc_power(current) {
56-
return parseFloat(((current * 3 * 230) / 1000).toFixed(2));
56+
return parseFloat(((current * 3 * 230) / 1000).toFixed(0));
5757
},
5858
dc_power2ac_current(power) {
5959
return parseFloat(((power * 1000) / 230 / 3).toFixed(2));

src/components/monitoring/OpenwbMonitoringProxy.vue

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<openwb-base-heading> Einstellungen für Modul "{{ monitoring.name }}" </openwb-base-heading>
33
<component
4-
:is="myComponent"
4+
:is="getMonitoringComponent()"
55
:monitoring="monitoring"
66
@update:configuration="updateConfiguration($event)"
77
/>
@@ -17,16 +17,14 @@ export default {
1717
monitoring: { type: Object, required: true },
1818
},
1919
emits: ["update:configuration"],
20-
computed: {
21-
myComponent() {
22-
console.debug(`loading monitoring: ${this.monitoring.name} (${this.monitoring.type})`);
20+
methods: {
21+
getMonitoringComponent() {
22+
console.debug(`loading monitoring: ${this.monitoring.type}`);
2323
return defineAsyncComponent({
2424
loader: () => import(`./${this.monitoring.type}/monitoring.vue`),
2525
errorComponent: OpenwbMonitoringFallback,
2626
});
2727
},
28-
},
29-
methods: {
3028
updateConfiguration(event) {
3129
this.$emit("update:configuration", event);
3230
},

src/components/ripple_control_receivers/OpenwbRippleControlReceiverProxy.vue

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<openwb-base-heading> Einstellungen für RSE-Modul "{{ rippleControlReceiver.name }}" </openwb-base-heading>
33
<component
4-
:is="myComponent"
4+
:is="getRippleControlReceiverComponent()"
55
:ripple-control-receiver="rippleControlReceiver"
66
@update:configuration="updateConfiguration($event)"
77
@send-command="sendCommand($event)"
@@ -18,18 +18,14 @@ export default {
1818
rippleControlReceiver: { type: Object, required: true },
1919
},
2020
emits: ["update:configuration", "sendCommand"],
21-
computed: {
22-
myComponent() {
23-
console.debug(
24-
`loading ripple control receiver: ${this.rippleControlReceiver.name} (${this.rippleControlReceiver.type})`,
25-
);
21+
methods: {
22+
getRippleControlReceiverComponent() {
23+
console.debug(`loading ripple control receiver: ${this.rippleControlReceiver.type}`);
2624
return defineAsyncComponent({
2725
loader: () => import(`./${this.rippleControlReceiver.type}/ripple_control_receiver.vue`),
2826
errorComponent: OpenwbRippleControlReceiverFallback,
2927
});
3028
},
31-
},
32-
methods: {
3329
// event pass through
3430
updateConfiguration(event) {
3531
this.$emit("update:configuration", event);

src/components/status/BatteryCard.vue

+20-47
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,22 @@
11
<template>
2-
<openwb-base-card
2+
<status-card
33
subtype="warning"
4-
:collapsible="true"
5-
:collapsed="true"
6-
class="pb-0"
4+
:component-id="battery.id"
5+
:state="$store.state.mqtt[baseTopic + '/get/fault_state']"
6+
:state-message="$store.state.mqtt[baseTopic + '/get/fault_str']"
77
>
8-
<template #header>
8+
<template #header-left>
99
<font-awesome-icon
1010
fixed-width
1111
:icon="['fas', 'car-battery']"
1212
/>
1313
{{ battery.name }}
1414
</template>
15-
<template #actions>
16-
<div
17-
v-if="getFaultStateSubtype(baseTopic) == 'success'"
18-
class="text-right"
19-
>
20-
{{ formatNumberTopic(baseTopic + "/get/power", 1, 1, 0.001) }}&nbsp;kW /
21-
{{ $store.state.mqtt[baseTopic + "/get/soc"] }}&nbsp;%
22-
</div>
23-
<span
24-
v-else
25-
:class="'subheader pill bg-' + getFaultStateSubtype(baseTopic)"
26-
>
27-
<div v-if="getFaultStateSubtype(baseTopic) == 'warning'">Warnung</div>
28-
<div v-else>Fehler</div>
29-
</span>
15+
<template #header-right>
16+
{{ formatNumberTopic(baseTopic + "/get/power", 1, 1, 0.001) }}&nbsp;kW /
17+
{{ $store.state.mqtt[baseTopic + "/get/soc"] }}&nbsp;%
3018
</template>
19+
<!-- Aktuelle Werte -->
3120
<openwb-base-card
3221
title="Aktuelle Werte"
3322
subtype="white"
@@ -45,6 +34,7 @@
4534
<div class="col text-right text-monospace pl-0">{{ $store.state.mqtt[baseTopic + "/get/soc"] }}&nbsp;%</div>
4635
</div>
4736
</openwb-base-card>
37+
<!-- Zählerstände -->
4838
<openwb-base-card
4939
title="Zählerstände"
5040
subtype="white"
@@ -75,51 +65,34 @@
7565
</div>
7666
</div>
7767
</openwb-base-card>
78-
<template #footer>
79-
<div class="container">
80-
<div class="row">
81-
<div class="col px-0">
82-
<openwb-base-alert :subtype="getFaultStateSubtype(baseTopic)">
83-
<font-awesome-icon
84-
fixed-width
85-
:icon="stateIcon"
86-
/>
87-
Modulmeldung:
88-
<span style="white-space: pre-wrap">{{ $store.state.mqtt[baseTopic + "/get/fault_str"] }}</span>
89-
</openwb-base-alert>
90-
</div>
91-
<div class="col col-auto pr-0">
92-
<div class="text-right">ID: {{ battery.id }}</div>
93-
</div>
94-
</div>
95-
</div>
96-
</template>
97-
</openwb-base-card>
68+
</status-card>
9869
</template>
9970

10071
<script>
10172
import ComponentState from "../mixins/ComponentState.vue";
73+
import StatusCard from "./StatusCard.vue";
10274
10375
import { library } from "@fortawesome/fontawesome-svg-core";
104-
import {
105-
faCheckCircle as fasCheckCircle,
106-
faExclamationTriangle as fasExclamationTriangle,
107-
faTimesCircle as fasTimesCircle,
108-
faCarBattery as fasCarBattery,
109-
} from "@fortawesome/free-solid-svg-icons";
76+
import { faCarBattery as fasCarBattery } from "@fortawesome/free-solid-svg-icons";
11077
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
11178
112-
library.add(fasCheckCircle, fasExclamationTriangle, fasTimesCircle, fasCarBattery);
79+
library.add(fasCarBattery);
11380
11481
export default {
11582
name: "BatteryCard",
11683
components: {
84+
StatusCard,
11785
FontAwesomeIcon,
11886
},
11987
mixins: [ComponentState],
12088
props: {
12189
battery: { type: Object, required: true },
12290
},
91+
data() {
92+
return {
93+
mqttTopicsToSubscribe: [`openWB/bat/${this.battery.id}/get/+`],
94+
};
95+
},
12396
computed: {
12497
baseTopic: {
12598
get() {

0 commit comments

Comments
 (0)