Skip to content

Commit afcdb9c

Browse files
authored
Merge pull request #2324 from Brett-S-OWB/koala-new-chargemodes
Fix reactivity for charge point vehicle selection + formatting
2 parents bf598cf + 7627714 commit afcdb9c

6 files changed

Lines changed: 8 additions & 7 deletions

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
</template>
3030

3131
<script setup lang="ts">
32+
import { computed } from 'vue';
3233
import { useMqttStore } from 'src/stores/mqtt-store';
3334
3435
const props = defineProps({
@@ -48,7 +49,7 @@ const connectedVehicle = mqttStore.chargePointConnectedVehicleInfo(
4849
props.chargePointId,
4950
);
5051
51-
const vehicles = mqttStore.vehicleList();
52+
const vehicles = computed(() => mqttStore.vehicleList);
5253
</script>
5354

5455
<style scoped>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</p>
1212
<p>
1313
Vehicle List:
14-
{{ mqttStore.vehicleList() }}
14+
{{ mqttStore.vehicleList }}
1515
</p>
1616
</div>
1717
</template>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const props = defineProps<{
2121
const mqttStore = useMqttStore();
2222
2323
const vehicle = computed(() => {
24-
return mqttStore.vehicleList().find((v) => v.id === props.vehicleId);
24+
return mqttStore.vehicleList.find((v) => v.id === props.vehicleId);
2525
});
2626
</script>
2727

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import VehicleCard from 'src/components/VehicleCard.vue';
1515
1616
const mqttStore = useMqttStore();
1717
18-
const vehicles = computed(() => mqttStore.vehicleList());
18+
const vehicles = computed(() => mqttStore.vehicleList);
1919
2020
const vehicleIds = computed(() => vehicles.value.map((vehicle) => vehicle.id));
2121
</script>

packages/modules/web_themes/koala/source/src/components/charts/historyChart/HistoryChart.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const gridMeterName = computed(() => {
101101
return 'Zähler';
102102
});
103103
104-
const vehicles = computed(() => mqttStore.vehicleList());
104+
const vehicles = computed(() => mqttStore.vehicleList);
105105
const chartRange = computed(
106106
() => mqttStore.themeConfiguration?.history_chart_range || 3600,
107107
);

packages/modules/web_themes/koala/source/src/stores/mqtt-store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,7 @@ export const useMqttStore = defineStore('mqtt', () => {
17751775
* Get a list of all vehicles
17761776
* @returns Vehicle[]
17771777
*/
1778-
const vehicleList = () => {
1778+
const vehicleList = computed(() => {
17791779
const list = getWildcardValues.value('openWB/vehicle/+/name');
17801780
// generate an array of objects, containing vehicle index and name
17811781
return Object.keys(list).map((key) => {
@@ -1785,7 +1785,7 @@ export const useMqttStore = defineStore('mqtt', () => {
17851785
name: list[key],
17861786
} as Vehicle;
17871787
});
1788-
};
1788+
});
17891789

17901790
/**
17911791
* Get scheduled charging plan/s data identified by the charge point id

0 commit comments

Comments
 (0)