Skip to content

Commit

Permalink
Merge branch 'master' into feat/loadpoint-config
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Oct 4, 2024
2 parents 67372e9 + 47c73a7 commit 419c9f0
Show file tree
Hide file tree
Showing 153 changed files with 4,672 additions and 1,818 deletions.
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
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
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
2 changes: 1 addition & 1 deletion assets/js/components/BatterySettingsModal.vue
Original file line number Diff line number Diff line change
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
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>
6 changes: 4 additions & 2 deletions assets/js/components/Energyflow/Energyflow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
:batterySoc="batterySoc"
:powerUnit="powerUnit"
:vehicleIcons="vehicleIcons"
:inPower="inPower"
:outPower="outPower"
/>
</div>
<div
Expand Down Expand Up @@ -130,7 +132,7 @@
/>
<EnergyflowEntry
:name="
$tc('main.energyflow.loadpoints', activeLoadpointsCount, {
$t('main.energyflow.loadpoints', activeLoadpointsCount, {
count: activeLoadpointsCount,
})
"
Expand Down Expand Up @@ -337,7 +339,7 @@ export default {
return this.fmtPricePerKWh(this.tariffGrid, this.currency, true);
},
batteryGridChargeLimitFmt() {
if (this.batteryGridChargeLimit === null || this.batteryGridChargeLimit === undefined) {
if (this.batteryGridChargeLimit === null) {
return;
}
if (this.co2Available) {
Expand Down
Loading

0 comments on commit 419c9f0

Please sign in to comment.