@@ -218,10 +218,20 @@ export default {
218
218
installedChargePointKey: { type: String , required: true },
219
219
installedChargePoint: { type: Object , required: true },
220
220
},
221
+ data () {
222
+ return {
223
+ mqttTopicsToSubscribe: [
224
+ ` openWB/chargepoint/${ this .installedChargePoint .id } /get/+` ,
225
+ ` "openWB/chargepoint/${ this .installedChargePoint .id } /get/connected_vehicle/info` ,
226
+ ` "openWB/chargepoint/${ this .installedChargePoint .id } /set/+` ,
227
+ ` "openWB/internal_chargepoint/${ this .installedChargePoint .id } /data/phases_to_use` ,
228
+ ],
229
+ };
230
+ },
221
231
computed: {
222
232
chargePointIndex: {
223
233
get () {
224
- return parseInt ( this .installedChargePointKey . match ( / (?: \/ )( \d + )(?= \/ ) / )[ 1 ]) ;
234
+ return this .installedChargePoint . id ;
225
235
},
226
236
},
227
237
baseTopic: {
@@ -231,9 +241,8 @@ export default {
231
241
},
232
242
chargingStatus: {
233
243
get () {
234
- let ID = this .chargePointIndex ;
235
- let plugState = this .$store .state .mqtt [" openWB/chargepoint/" + ID + " /get/plug_state" ];
236
- let chargeState = this .$store .state .mqtt [" openWB/chargepoint/" + ID + " /get/charge_state" ];
244
+ let plugState = this .$store .state .mqtt [this .baseTopic + " /get/plug_state" ];
245
+ let chargeState = this .$store .state .mqtt [this .baseTopic + " /get/charge_state" ];
237
246
238
247
if (plugState == 1 && chargeState == 1 ) {
239
248
return { icon: [" fas" , " plug-circle-bolt" ], text: " Fahrzeug angesteckt, Ladevorgang aktiv" };
0 commit comments