Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/evcc-io/evcc into device/…
Browse files Browse the repository at this point in the history
…ocpp-new-templates
  • Loading branch information
premultiply committed Oct 16, 2024
2 parents c2e07ba + f0d851a commit 58030dd
Show file tree
Hide file tree
Showing 304 changed files with 12,413 additions and 9,807 deletions.
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ body:
- Docker container
- HomeAssistant Add-on

- type: checkboxes
id: nightly
attributes:
label: Nightly build
description: Check if issue as already been fixed in the latest nightly build
options:
- label: I have verified that the issue is reproducible with the latest nightly build
required: true

- type: input
attributes:
label: Version
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ jobs:
go-version: ${{ env.GO_VERSION }}
id: go

- name: Install Cloudsmith CLI
run: pip install --upgrade cloudsmith-cli

- name: Patch ASN1
run: make patch-asn1-sudo

Expand All @@ -111,6 +108,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TESLA_CLIENT_ID: ${{ secrets.TESLA_CLIENT_ID }}

- uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install Cloudsmith CLI
run: pip install --upgrade cloudsmith-cli

- name: Publish .deb to Cloudsmith
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ jobs:
go-version: ${{ env.GO_VERSION }}
id: go

- name: Install Cloudsmith CLI
run: pip install --upgrade cloudsmith-cli

- name: Patch ASN1
run: make patch-asn1-sudo

Expand Down Expand Up @@ -105,6 +102,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
TESLA_CLIENT_ID: ${{ secrets.TESLA_CLIENT_ID }}

- uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install Cloudsmith CLI
run: pip install --upgrade cloudsmith-cli

- name: Publish .deb to Cloudsmith
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
Expand Down Expand Up @@ -138,7 +142,7 @@ jobs:

- name: Update version
run: |
sed -i -e s#\"version.*#\"version\":\ \"$(echo ${{ github.ref }} | sed -e s#refs/tags/##)\",# ./hassio/evcc/config.json
sed -i -e s#version.*#version\:\ $(echo ${{ github.ref }} | sed -e s#refs/tags/##)# ./hassio/evcc/config.yaml
- name: Push
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ asset-stats.html
/playwright-report/
/playwright/.cache/
.gitpod.yml
/evcc.db
7 changes: 6 additions & 1 deletion .goreleaser-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: 2

dist: release
release:
disable: true
Expand Down Expand Up @@ -48,7 +50,7 @@ checksum:
name_template: "checksums.txt"

snapshot:
name_template: '{{ .Version }}{{ if eq (len (split .Version ".")) 2 }}.0{{ end }}+{{ .Timestamp }}'
version_template: '{{ .Version }}{{ if eq (len (split .Version ".")) 2 }}.0{{ end }}+{{ .Timestamp }}'

changelog:
sort: asc
Expand All @@ -73,6 +75,9 @@ nfpms:
formats:
- deb

dependencies:
- adduser

contents:
- src: ./packaging/init/evcc.service
dst: /lib/systemd/system/evcc.service
Expand Down
3 changes: 3 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ nfpms:
formats:
- deb

dependencies:
- adduser

contents:
- src: ./packaging/init/evcc.service
dst: /lib/systemd/system/evcc.service
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,5 @@ patch-asn1::

upgrade::
$(shell go list -u -f '{{if (and (not (or .Main .Indirect)) .Update)}}{{.Path}}{{end}}' -m all | xargs go get)
go get modernc.org/sqlite@latest
go mod tidy
5 changes: 5 additions & 0 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ type BatteryCapacity interface {
Capacity() float64
}

// BatteryMaxACPower provides max AC power in W
type BatteryMaxACPower interface {
MaxACPower() float64
}

// ChargeState provides current charging status
type ChargeState interface {
Status() (ChargeStatus, error)
Expand Down
3 changes: 3 additions & 0 deletions api/globalconfig/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ type Influx struct {
Org string `json:"org"`
User string `json:"user"`
Password string `json:"password"`
Insecure bool `json:"insecure"`
}

// Redacted implements the redactor interface used by the tee publisher
Expand All @@ -98,11 +99,13 @@ func (c Influx) Redacted() any {
Database string `json:"database"`
Org string `json:"org"`
User string `json:"user"`
Insecure bool `json:"insecure"`
}{
URL: c.URL,
Database: c.Database,
Org: c.Org,
User: c.User,
Insecure: c.Insecure,
}
}

Expand Down
4 changes: 4 additions & 0 deletions assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ body {
color: var(--evcc-default-text);
}

body:not(.modal-open) {
overflow-y: scroll;
}

h1,
h2,
h3,
Expand Down
16 changes: 11 additions & 5 deletions assets/js/components/BatterySettingsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
@change="changeBufferStart"
>
<span class="text-decoration-underline">
{{ bufferStartOption.name }}
{{ selectedBufferStartName }}
</span>
</CustomSelect>
</small>
Expand Down Expand Up @@ -272,7 +272,7 @@ export default {
bufferStartSoc: Number,
batteryDischargeControl: Boolean,
battery: { type: Array, default: () => [] },
batteryGridChargeLimit: Number,
batteryGridChargeLimit: { type: Number, default: null },
smartCostType: String,
tariffGrid: Number,
currency: String,
Expand Down Expand Up @@ -332,9 +332,7 @@ export default {
for (let i = 100; i >= this.bufferSoc; i -= 5) {
options.push({
value: i,
name: this.$t(`batterySettings.bufferStart.${i === 100 ? "full" : "above"}`, {
soc: this.fmtSoc(i),
}),
name: this.getBufferStartName(i),
});
}
options.push({
Expand All @@ -346,6 +344,9 @@ export default {
bufferStartOption() {
return this.bufferStartOptions.find((option) => this.bufferStartSoc >= option.value);
},
selectedBufferStartName() {
return this.getBufferStartName(this.selectedBufferStartSoc);
},
topHeight() {
return 100 - (this.bufferSoc || 100);
},
Expand Down Expand Up @@ -488,6 +489,11 @@ export default {
console.error(err);
}
},
getBufferStartName(soc) {
return this.$t(`batterySettings.bufferStart.${soc === 100 ? "full" : "above"}`, {
soc: this.fmtSoc(soc),
});
},
},
};
</script>
Expand Down
2 changes: 1 addition & 1 deletion assets/js/components/ChargingPlanWarnings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default {
return this.fmtWh(this.planEnergy * 1e3);
},
costLimitExists: function () {
return this.smartCostLimit !== 0;
return this.smartCostLimit !== null;
},
costLimitText: function () {
if (this.isCo2) {
Expand Down
13 changes: 13 additions & 0 deletions assets/js/components/Config/InfluxModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,19 @@
autocomplete="off"
/>
</FormRow>
<FormRow id="influxInsecure" :label="$t('config.influx.labelInsecure')">
<div class="d-flex">
<input
class="form-check-input"
id="influxInsecure"
type="checkbox"
v-model="values.insecure"
/>
<label class="form-check-label ms-2" for="influxInsecure">
{{ $t("config.influx.labelCheckInsecure") }}
</label>
</div>
</FormRow>
<p>
<button
v-if="showV1(values)"
Expand Down
21 changes: 20 additions & 1 deletion assets/js/components/Config/MqttModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,36 @@
</label>
</div>
</FormRow>
<PropertyCollapsible>
<template #advanced>
<FormRow id="mqttCaCert" :label="$t('config.mqtt.labelCaCert')" optional>
<PropertyCertField id="mqttCaCert" v-model="values.caCert" />
</FormRow>
<FormRow
id="mqttClientCert"
:label="$t('config.mqtt.labelClientCert')"
optional
>
<PropertyCertField id="mqttClientCert" v-model="values.clientCert" />
</FormRow>
<FormRow id="mqttClientKey" :label="$t('config.mqtt.labelClientKey')" optional>
<PropertyCertField id="mqttClientKey" v-model="values.clientKey" />
</FormRow>
</template>
</PropertyCollapsible>
</template>
</JsonModal>
</template>

<script>
import JsonModal from "./JsonModal.vue";
import FormRow from "./FormRow.vue";
import PropertyCollapsible from "./PropertyCollapsible.vue";
import PropertyCertField from "./PropertyCertField.vue";
export default {
name: "MqttModal",
components: { FormRow, JsonModal },
components: { FormRow, JsonModal, PropertyCollapsible, PropertyCertField },
emits: ["changed"],
};
</script>
55 changes: 55 additions & 0 deletions assets/js/components/Config/PropertyCertField.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<template>
<div>
<textarea :id="id" v-model="value" class="form-control" rows="3" />
<div class="d-flex justify-content-end">
<button
type="button"
class="btn btn-link btn-sm text-muted pe-0"
@click="openFilePicker"
>
{{ $t("config.general.readFromFile") }}
</button>
<input
type="file"
ref="fileInput"
class="d-none"
@change="readFile"
accept=".crt,.pem,.cer,.csr,.key"
/>
</div>
</div>
</template>

<script>
export default {
name: "PropertyCertField",
props: {
id: String,
modelValue: String,
},
emits: ["update:modelValue"],
computed: {
value: {
get() {
return this.modelValue;
},
set(value) {
this.$emit("update:modelValue", value);
},
},
},
methods: {
openFilePicker() {
this.$refs.fileInput.click();
},
readFile(event) {
const file = event.target.files[0];
const reader = new FileReader();
reader.onload = (e) => {
this.value = e.target.result;
};
reader.readAsText(file);
},
},
};
</script>
29 changes: 28 additions & 1 deletion assets/js/components/Energyflow/Energyflow.story.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ import Energyflow from "./Energyflow.vue";
pvConfigured
batteryConfigured
:pvPower="300"
:gridPower="5500"
:gridPower="6500"
:homePower="1000"
:loadpointsCompact="[
{ power: 5000, icon: 'car', charging: true },
Expand Down Expand Up @@ -167,5 +167,32 @@ import Energyflow from "./Energyflow.vue";
:pv="[{ power: 5000 }, { power: 2300 }]"
/>
</Variant>
<Variant title="low input">
<Energyflow
gridConfigured
pvConfigured
:pvPower="2000"
:gridPower="-2000"
:loadpointsCompact="[{ power: 1000, icon: 'car', charging: true }]"
/>
</Variant>
<Variant title="low output">
<Energyflow
gridConfigured
pvConfigured
:pvPower="3000"
:gridPower="-1000"
:loadpointsCompact="[{ power: 1700, icon: 'car', charging: true }]"
/>
</Variant>
<Variant title="low output (&lt; 10%)">
<Energyflow
gridConfigured
pvConfigured
:pvPower="3000"
:gridPower="-1000"
:loadpointsCompact="[{ power: 1800, icon: 'car', charging: true }]"
/>
</Variant>
</Story>
</template>
Loading

0 comments on commit 58030dd

Please sign in to comment.