@@ -113,8 +113,7 @@ export default {
mixins: [formatter],
props: {
id: Number,
- timerActive: Boolean,
- timerSet: Boolean,
+ targetTimeActive: Boolean,
targetTime: String,
targetSoC: Number,
},
@@ -123,7 +122,7 @@ export default {
},
computed: {
targetChargeEnabled: function () {
- return this.targetTime && this.timerSet;
+ return this.targetTime;
},
selectedTargetTimeValid: function () {
const now = new Date();
@@ -197,12 +196,12 @@ export default {
minTime: function () {
return new Date().toISOString().split("T")[1].slice(0, -8);
},
- removeTargetTime: function () {
- this.$emit("target-time-updated", new Date(null));
- },
- saveTargetTime: function () {
+ setTargetTime: function () {
this.$emit("target-time-updated", this.selectedTargetTime);
},
+ removeTargetTime: function () {
+ this.$emit("target-time-removed");
+ },
},
};
diff --git a/assets/js/components/Vehicle.stories.js b/assets/js/components/Vehicle.stories.js
index 81e2a995d..10802ccb3 100644
--- a/assets/js/components/Vehicle.stories.js
+++ b/assets/js/components/Vehicle.stories.js
@@ -76,8 +76,7 @@ TargetChargePlanned.args = {
vehicleSoC: 31,
minSoC: 20,
charging: false,
- timerSet: true,
- timerActive: false,
+ targetTimeActive: false,
targetSoC: 45,
targetTime: hoursFromNow(14),
id: 0,
@@ -92,8 +91,7 @@ TargetChargeActive.args = {
vehicleSoC: 66,
minSoC: 30,
charging: true,
- timerSet: true,
- timerActive: true,
+ targetTimeActive: true,
targetSoC: 80,
targetTime: hoursFromNow(2),
id: 0,
diff --git a/assets/js/components/Vehicle.vue b/assets/js/components/Vehicle.vue
index d70d0be9d..6c3f4ced8 100644
--- a/assets/js/components/Vehicle.vue
+++ b/assets/js/components/Vehicle.vue
@@ -7,7 +7,8 @@
@@ -31,8 +32,7 @@ export default {
charging: Boolean,
minSoC: Number,
vehicleTitle: String,
- timerActive: Boolean,
- timerSet: Boolean,
+ targetTimeActive: Boolean,
targetTime: String,
targetSoC: Number,
},
@@ -48,9 +48,12 @@ export default {
targetSocUpdated: function (targetSoC) {
this.$emit("target-soc-updated", targetSoC);
},
- targetTimeUpdated: function (targetTime) {
+ setTargetTime: function (targetTime) {
this.$emit("target-time-updated", targetTime);
},
+ removeTargetTime: function () {
+ this.$emit("target-time-removed");
+ },
},
};
diff --git a/assets/js/components/VehicleSubline.vue b/assets/js/components/VehicleSubline.vue
index ae8c82000..c6fc8aa69 100644
--- a/assets/js/components/VehicleSubline.vue
+++ b/assets/js/components/VehicleSubline.vue
@@ -6,7 +6,11 @@
{{ $t("main.vehicleSubline.mincharge", { soc: minSoC }) }}
-
+
@@ -22,8 +26,7 @@ export default {
id: Number,
vehicleSoC: Number,
minSoC: Number,
- timerActive: Boolean,
- timerSet: Boolean,
+ targetTimeActive: Boolean,
targetTime: String,
targetSoC: Number,
},
@@ -36,9 +39,12 @@ export default {
},
},
methods: {
- targetTimeUpdated: function (targetTime) {
+ setTargetTime: function (targetTime) {
this.$emit("target-time-updated", targetTime);
},
+ removeTargetTime: function () {
+ this.$emit("target-time-removed");
+ },
},
};
diff --git a/core/loadpoint_api.go b/core/loadpoint_api.go
index 660a241fa..b88d93b0d 100644
--- a/core/loadpoint_api.go
+++ b/core/loadpoint_api.go
@@ -118,11 +118,14 @@ func (lp *LoadPoint) SetTargetCharge(finishAt time.Time, soc int) {
// apply immediately
if lp.socTimer.Time != finishAt || lp.SoC.Target != soc {
- lp.publish("targetTime", finishAt)
lp.socTimer.Time = finishAt
+ lp.publish("targetTime", finishAt)
- lp.setTargetSoC(soc)
- lp.requestUpdate()
+ // don't remove soc
+ if !finishAt.IsZero() {
+ lp.setTargetSoC(soc)
+ lp.requestUpdate()
+ }
}
}
diff --git a/core/soc/timer.go b/core/soc/timer.go
index 29620a6f2..959e33c10 100644
--- a/core/soc/timer.go
+++ b/core/soc/timer.go
@@ -55,9 +55,7 @@ func (lp *Timer) DemandActive() bool {
}
defer func() {
- lp.Publish("timerSet", lp.Time.After(time.Now()))
- lp.Publish("timerActive", lp.active)
- lp.Publish("timerProjectedEnd", lp.finishAt)
+ lp.Publish("targetTimeActive", lp.active)
}()
// power
diff --git a/dist/index.html b/dist/index.html
index 56ac90fb6..d73a4fe3f 100644
--- a/dist/index.html
+++ b/dist/index.html
@@ -1,4 +1,4 @@
-