+
@@ -18,14 +18,31 @@ export default {
name: "Mode",
props: {
mode: String,
+ pvPossible: Boolean,
+ hasSmartCost: Boolean,
},
emits: ["updated"],
- data() {
- return {
- modes: ["off", "pv", "minpv", "now"],
- };
+
+ computed: {
+ modes: function () {
+ if (this.pvPossible) {
+ return ["off", "pv", "minpv", "now"];
+ }
+ if (this.hasSmartCost) {
+ return ["off", "pv", "now"];
+ }
+ return ["off", "now"];
+ },
},
methods: {
+ label: function (mode) {
+ // rename pv mode to smart for non-pv and dynamic tariffs scenarios
+ // TODO: rollout smart name for everyting later
+ if (mode === "pv" && !this.pvPossible && this.hasSmartCost) {
+ return this.$t("main.mode.smart");
+ }
+ return this.$t(`main.mode.${mode}`);
+ },
isActive: function (mode) {
return this.mode === mode;
},
diff --git a/assets/js/components/Site.vue b/assets/js/components/Site.vue
index 5e6d27dd7..267a6b4aa 100644
--- a/assets/js/components/Site.vue
+++ b/assets/js/components/Site.vue
@@ -29,6 +29,8 @@
:tariffGrid="tariffGrid"
:tariffCo2="tariffCo2"
:currency="currency"
+ :gridConfigured="gridConfigured"
+ :pvConfigured="pvConfigured"
/>
diff --git a/assets/js/views/Config.vue b/assets/js/views/Config.vue
index 1306c85ea..c33d1b706 100644
--- a/assets/js/views/Config.vue
+++ b/assets/js/views/Config.vue
@@ -17,7 +17,6 @@