evcc-io/assets/js/components/HemsWarning.vue

25 lines
709 B
Vue

<template>
<div v-if="lpcLimit" class="alert alert-warning" data-testid="hems-warning">
<strong>{{ $t("main.hemsWarning.title") }}</strong>
{{ $t("main.hemsWarning.description", { limit: fmtW(lpcLimit, POWER_UNIT.KW) }) }}
</div>
</template>
<script lang="ts">
import { defineComponent, type PropType } from "vue";
import { type Circuit, GRID_CONTROL } from "@/types/evcc";
import formatter from "@/mixins/formatter";
export default defineComponent({
name: "HemsWarning",
mixins: [formatter],
props: {
circuits: { type: Object as PropType<Record<string, Circuit>> },
},
computed: {
lpcLimit(): number | null {
return this.circuits?.[GRID_CONTROL]?.maxPower || null;
},
},
});
</script>