Skip to content

Commit d4de20f

Browse files
authored
Colors theme fix: chargepoint switches (#3190)
* fix chargepoint switches
1 parent 9a6be72 commit d4de20f

2 files changed

Lines changed: 2 additions & 56 deletions

File tree

packages/modules/web_themes/colors/source/src/assets/js/sendMessages.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ const topics: { [topic: string]: string } = {
1212
chargeMode:
1313
'openWB/set/vehicle/template/charge_template/%/chargemode/selected',
1414
cpPriority: 'openWB/set/vehicle/template/charge_template/%/prio',
15-
cpTimedCharging:
16-
'openWB/set/vehicle/template/charge_template/%/time_charging/active',
1715
pvBatteryPriority:
1816
'openWB/set/general/chargemode_config/pv_charging/bat_mode',
1917
cpVehicle: 'openWB/set/chargepoint/%/config/ev',

packages/modules/web_themes/colors/source/src/components/chargePointList/model.ts

Lines changed: 2 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -133,21 +133,15 @@ export class ChargePoint implements PowerItem {
133133
updateChargeTemplate(this.id)
134134
}
135135
}
136-
/* updateChargeMode(cm: ChargeMode) {
137-
this._chargeMode = cm
138-
} */
139136
get hasPriority() {
140137
return this.chargeTemplate?.prio ?? false
141138
}
142139
set hasPriority(prio: boolean) {
143140
if (this.chargeTemplate) {
144141
this.chargeTemplate.prio = prio
145-
updateServer('cpPriority', prio, this.id)
142+
updateChargeTemplate(this.id)
146143
}
147144
}
148-
/* updateCpPriority(prio: boolean) {
149-
this._hasPriority = prio
150-
} */
151145
get timedCharging() {
152146
if (this.chargeTemplate) {
153147
return this.chargeTemplate.time_charging.active
@@ -156,9 +150,8 @@ export class ChargePoint implements PowerItem {
156150
}
157151
}
158152
set timedCharging(setting: boolean) {
159-
// chargeTemplates[this.chargeTemplate].time_charging.active = false
160153
this.chargeTemplate!.time_charging.active = setting
161-
updateServer('cpTimedCharging', setting, this.id)
154+
updateChargeTemplate(this.id)
162155
}
163156
get instantTargetCurrent() {
164157
return this.chargeTemplate?.chargemode.instant_charging.current ?? 0
@@ -169,10 +162,6 @@ export class ChargePoint implements PowerItem {
169162
updateChargeTemplate(this.id)
170163
}
171164
}
172-
/* updateInstantTargetCurrent(current: number) {
173-
this._instantTargetCurrent = current
174-
}
175-
*/
176165
get instantChargeLimitMode() {
177166
return (
178167
this.chargeTemplate?.chargemode.instant_charging.limit.selected ?? 'none'
@@ -184,9 +173,6 @@ export class ChargePoint implements PowerItem {
184173
updateChargeTemplate(this.id)
185174
}
186175
}
187-
/* updateInstantChargeLimitMode(mode: string) {
188-
this._instantChargeLimitMode = mode
189-
} */
190176
get instantTargetSoc() {
191177
return this.chargeTemplate?.chargemode.instant_charging.limit.soc ?? 0
192178
}
@@ -196,9 +182,6 @@ export class ChargePoint implements PowerItem {
196182
updateChargeTemplate(this.id)
197183
}
198184
}
199-
/* updateInstantTargetSoc(soc: number) {
200-
this._instantTargetSoc = soc
201-
} */
202185
get instantMaxEnergy() {
203186
return this.chargeTemplate?.chargemode.instant_charging.limit.amount ?? 0
204187
}
@@ -208,9 +191,6 @@ export class ChargePoint implements PowerItem {
208191
updateChargeTemplate(this.id)
209192
}
210193
}
211-
/* updateInstantMaxEnergy(max: number) {
212-
this._instantMaxEnergy = max
213-
} */
214194
get instantTargetPhases() {
215195
return this.chargeTemplate?.chargemode.instant_charging.phases_to_use ?? 0
216196
}
@@ -220,7 +200,6 @@ export class ChargePoint implements PowerItem {
220200
updateChargeTemplate(this.id)
221201
}
222202
}
223-
224203
get pvFeedInLimit() {
225204
return this.chargeTemplate?.chargemode.pv_charging.feed_in_limit ?? false
226205
}
@@ -230,9 +209,6 @@ export class ChargePoint implements PowerItem {
230209
updateChargeTemplate(this.id)
231210
}
232211
}
233-
/* updatePvFeedInLimit(setting: boolean) {
234-
this._pvFeedInLimit = setting
235-
} */
236212
get pvMinCurrent() {
237213
return this.chargeTemplate?.chargemode.pv_charging.min_current ?? 0
238214
}
@@ -242,9 +218,6 @@ export class ChargePoint implements PowerItem {
242218
updateChargeTemplate(this.id)
243219
}
244220
}
245-
/* updatePvMinCurrent(min: number) {
246-
this._pvMinCurrent = min
247-
} */
248221
get pvMaxSoc() {
249222
return this._pvMaxSoc
250223
}
@@ -264,9 +237,6 @@ export class ChargePoint implements PowerItem {
264237
updateChargeTemplate(this.id)
265238
}
266239
}
267-
/* updatePvMinSoc(min: number) {
268-
this._pvMinSoc = min
269-
} */
270240
get pvMinSocCurrent() {
271241
return this.chargeTemplate?.chargemode.pv_charging.min_soc_current ?? 0
272242
}
@@ -400,28 +370,6 @@ export class ChargePoint implements PowerItem {
400370
return 0
401371
}
402372
}
403-
/* toPowerItem(): PowerItem {
404-
return {
405-
name: this.name,
406-
type: PowerItemType.chargepoint,
407-
power: this.power,
408-
now : {
409-
energy: this.dailyYield,
410-
energyPv: this.energyPv,
411-
energyBat: this.energyBat,
412-
pvPercentage: this.pvPercentage,
413-
},
414-
past: {
415-
energy: this.dailyYield,
416-
energyPv: this.energyPv,
417-
energyBat: this.energyBat,
418-
pvPercentage: this.pvPercentage,
419-
},
420-
color: this.color,
421-
icon: this.icon,
422-
showInGraph: true,
423-
}
424-
} */
425373
}
426374
export class Vehicle {
427375
id: number

0 commit comments

Comments
 (0)