Skip to content

Commit c795019

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 70f5983 + fa5af2d commit c795019

File tree

418 files changed

+19610
-11818
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

418 files changed

+19610
-11818
lines changed

.eslintrc.cjs

+1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ module.exports = {
1818
"vue/attribute-hyphenation": "off",
1919
"vue/multi-word-component-names": "off",
2020
"vue/no-reserved-component-names": "off",
21+
"no-param-reassign": "error",
2122
},
2223
};

.github/ISSUE_TEMPLATE/bug_report.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ body:
6363
- Docker container
6464
- HomeAssistant Add-on
6565

66+
- type: checkboxes
67+
id: nightly
68+
attributes:
69+
label: Nightly build
70+
description: Check if issue as already been fixed in the latest nightly build
71+
options:
72+
- label: I have verified that the issue is reproducible with the latest nightly build
73+
required: true
74+
6675
- type: input
6776
attributes:
6877
label: Version

.github/workflows/default.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Default
22

33
env:
4-
GO_VERSION: ^1.22
4+
GO_VERSION: ^1.23
55

66
on:
77
push:
@@ -74,7 +74,7 @@ jobs:
7474
7575
- uses: actions/setup-node@v4
7676
with:
77-
node-version: "18"
77+
node-version: "22"
7878
cache: "npm"
7979

8080
- run: mkdir dist && touch dist/empty
@@ -148,7 +148,7 @@ jobs:
148148

149149
- uses: actions/setup-node@v4
150150
with:
151-
node-version: "18"
151+
node-version: "22"
152152
cache: "npm"
153153

154154
- name: Install
@@ -199,7 +199,7 @@ jobs:
199199
200200
- uses: actions/setup-node@v4
201201
with:
202-
node-version: "18"
202+
node-version: "22"
203203
cache: "npm"
204204

205205
- name: Build UI

.github/workflows/documentation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Deploy updated templates
22

33
env:
4-
GO_VERSION: ^1.22
4+
GO_VERSION: ^1.23
55

66
on:
77
schedule:

.github/workflows/nightly.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Nightly Build
22

33
env:
4-
GO_VERSION: ^1.22
4+
GO_VERSION: ^1.23
55

66
on:
77
schedule: # runs on the default branch: master

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Release
22

33
env:
4-
GO_VERSION: ^1.22
4+
GO_VERSION: ^1.23
55

66
on:
77
push:

.github/workflows/website.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Deploy data to website
22

33
env:
4-
GO_VERSION: ^1.22
4+
GO_VERSION: ^1.23
55

66
on:
77
release:

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@ asset-stats.html
4141
/test-results/
4242
/playwright-report/
4343
/playwright/.cache/
44+
.gitpod.yml
45+
/evcc.db
46+
4447
debug_sensonet_reldata.txt
4548
debug_sensonet_system.txt

.golangci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
run:
2-
go: "1.22"
2+
go: "1.23"
33

44
issues:
55
exclude:
@@ -14,7 +14,6 @@ linters-settings:
1414
linters:
1515
disable-all: true
1616
enable:
17-
- dogsled
1817
- durationcheck
1918
- gci
2019
- gofmt
@@ -37,6 +36,7 @@ linters:
3736
- whitespace
3837

3938
# fixme
39+
# - dogsled
4040
# - bodyclose
4141
# - exhaustive
4242
# - exportloopref

.goreleaser.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ checksum:
5555
name_template: "checksums.txt"
5656

5757
snapshot:
58-
name_template: "{{ .Tag }}-next"
58+
version_template: "{{ .Tag }}-next"
5959

6060
changelog:
6161
sort: asc

CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#### Development environment
66

7-
Developing evcc requires [Go][1] 1.22 and [Node][2] 18. We recommend VSCode with the [Go](https://marketplace.visualstudio.com/items?itemName=golang.Go), [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) and [Vetur](https://marketplace.visualstudio.com/items?itemName=octref.vetur) extensions.
7+
Developing evcc requires [Go][1] 1.23 and [Node][2] 22. We recommend VSCode with the [Go](https://marketplace.visualstudio.com/items?itemName=golang.Go), [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) and [Vetur](https://marketplace.visualstudio.com/items?itemName=octref.vetur) extensions.
88

99
We use linters (golangci-lint, Prettier) to keep a coherent source code formatting. It's recommended to use the format-on-save feature of your editor. You can manually reformat your code by running:
1010

@@ -15,14 +15,14 @@ make lint-ui
1515

1616
#### Changing device templates
1717

18-
evcc supports a massive amount of different devices. To keep our documentation and website in sync with the latest software the core project (this repo) generates meta-data that's pushed to the `docs` and `evcc.io` repository. Make sure to update this meta-data every time you make changes to a templates.
18+
evcc supports a massive amount of different devices. To keep our documentation and website in sync with the latest software the core project (this repo) generates meta-data that's pushed to the `docs` and `evcc.io` repository.
19+
20+
You can verify the generated meta-data by running:
1921

2022
```sh
2123
make docs
2224
```
2325

24-
If you miss one of the above steps Gitub Actions will likely trigger a **Porcelain** error.
25-
2626
### Building from source
2727

2828
Install prerequisites (once):

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# STEP 1 build ui
2-
FROM --platform=$BUILDPLATFORM node:18-alpine as node
2+
FROM --platform=$BUILDPLATFORM node:22-alpine as node
33

44
RUN apk update && apk add --no-cache make
55

@@ -20,7 +20,7 @@ RUN make ui
2020

2121

2222
# STEP 2 build executable binary
23-
FROM --platform=$BUILDPLATFORM golang:1.22-alpine as builder
23+
FROM --platform=$BUILDPLATFORM golang:1.23-alpine as builder
2424

2525
# Install git + SSL ca certificates.
2626
# Git is required for fetching the dependencies.

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,8 @@ patch-asn1::
140140
cat $(GOROOT)/src/vendor/golang.org/x/crypto/cryptobyte/asn1.go | grep -C 1 "out = true"
141141
patch -N -t -d $(GOROOT)/src/vendor/golang.org/x/crypto/cryptobyte -i $(CURRDIR)/packaging/patch/asn1.diff
142142
cat $(GOROOT)/src/vendor/golang.org/x/crypto/cryptobyte/asn1.go | grep -C 1 "out = true"
143+
144+
upgrade::
145+
$(shell go list -u -f '{{if (and (not (or .Main .Indirect)) .Update)}}{{.Path}}{{end}}' -m all | xargs go get)
146+
go get modernc.org/sqlite@latest
147+
go mod tidy

api/api.go

+4
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ type ChargeState interface {
4949
Status() (ChargeStatus, error)
5050
}
5151

52+
type StatusReasoner interface {
53+
StatusReason() (Reason, error)
54+
}
55+
5256
// CurrentController provides settings charging maximum charging current
5357
type CurrentController interface {
5458
MaxCurrent(current int64) error

api/rates.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func (r Rates) Sort() {
3131
// Current returns the rates current rate or error
3232
func (r Rates) Current(now time.Time) (Rate, error) {
3333
for _, rr := range r {
34-
if (rr.Start.Before(now) || rr.Start.Equal(now)) && rr.End.After(now) {
34+
if !rr.Start.After(now) && rr.End.After(now) {
3535
return rr, nil
3636
}
3737
}

api/reason.go

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package api
2+
3+
type Reason int
4+
5+
//go:generate enumer -type Reason -trimprefix Reason -transform=lower
6+
const (
7+
ReasonUnknown Reason = iota
8+
ReasonWaitingForAuthorization
9+
ReasonDisconnectRequired
10+
)

api/reason_enumer.go

+82
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/app.css

+11
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ body {
112112
color: var(--evcc-default-text);
113113
}
114114

115+
body:not(.modal-open) {
116+
overflow-y: scroll;
117+
}
118+
115119
h1,
116120
h2,
117121
h3,
@@ -184,6 +188,13 @@ a:hover {
184188
--bs-btn-border-width: 2px;
185189
}
186190

191+
.btn-reset {
192+
border: none;
193+
background: none;
194+
padding: 0;
195+
color: inherit;
196+
}
197+
187198
.btn-primary,
188199
.btn-primary:focus {
189200
background-color: var(--bs-primary);

assets/js/api.js

+16
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,27 @@ const { protocol, hostname, port, pathname } = window.location;
55

66
const base = protocol + "//" + hostname + (port ? ":" + port : "") + pathname;
77

8+
// override the way axios serializes arrays in query parameters (a=1&a=2&a=3 instead of a[]=1&a[]=2&a[]=3)
9+
function customParamsSerializer(params) {
10+
const queryString = Object.keys(params)
11+
.filter((key) => params[key] !== null)
12+
.map((key) => {
13+
const value = params[key];
14+
if (Array.isArray(value)) {
15+
return value.map((v) => `${encodeURIComponent(key)}=${encodeURIComponent(v)}`).join("&");
16+
}
17+
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
18+
})
19+
.join("&");
20+
return queryString;
21+
}
22+
823
const api = axios.create({
924
baseURL: base + "api/",
1025
headers: {
1126
Accept: "application/json",
1227
},
28+
paramsSerializer: customParamsSerializer,
1329
});
1430

1531
// global error handling

0 commit comments

Comments
 (0)