Skip to content

Commit

Permalink
Merge branch 'master' into feat/ocpp-cp-centered
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Aug 28, 2024
2 parents 44c67d7 + 0d7cdbe commit 3c2ec09
Show file tree
Hide file tree
Showing 7 changed files with 1,266 additions and 466 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "22"
cache: "npm"

- run: mkdir dist && touch dist/empty
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "22"
cache: "npm"

- name: Install
Expand Down Expand Up @@ -199,7 +199,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "22"
cache: "npm"

- name: Build UI
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#### Development environment

Developing evcc requires [Go][1] 1.23 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.
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.

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:

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# STEP 1 build ui
FROM --platform=$BUILDPLATFORM node:18-alpine as node
FROM --platform=$BUILDPLATFORM node:22-alpine as node

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

Expand Down
1 change: 0 additions & 1 deletion charger/ocpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ func NewOCPP(id string, connector int, idtag string,
timeout: timeout,
}

// CONN
if cp.HasRemoteTriggerFeature {
if err := conn.TriggerMessageRequest(core.StatusNotificationFeatureName); err != nil {
c.log.DEBUG.Printf("failed triggering StatusNotification: %v", err)
Expand Down
1,683 changes: 1,226 additions & 457 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"eslint-plugin-prettier": "^5.0.0-alpha.1",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-vue": "^9.3.0",
"happy-dom": "^14.0.0",
"happy-dom": "^15.0.0",
"histoire": "^0.17.0",
"markty-toml": "^0.1.1",
"prettier": "^3.0.0",
Expand All @@ -59,8 +59,8 @@
"wait-on": "^8.0.0"
},
"engines": {
"npm": ">=8.0.0",
"node": ">=18.0.0"
"npm": ">=10.0.0",
"node": ">=22.0.0"
},
"license": "MIT",
"repository": "github:evcc-io/evcc",
Expand Down
32 changes: 32 additions & 0 deletions vehicle/renault/provider.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
package renault

import (
"net/http"
"slices"
"strings"
"time"

"github.com/evcc-io/evcc/api"
"github.com/evcc-io/evcc/provider"
"github.com/evcc-io/evcc/util/request"
"github.com/evcc-io/evcc/vehicle/renault/kamereon"
)

// Provider is an api.Vehicle implementation for PSA cars
type Provider struct {
batteryG func() (kamereon.Response, error)
cockpitG func() (kamereon.Response, error)
hvacG func() (kamereon.Response, error)
wakeup func() (kamereon.Response, error)
position func() (kamereon.Response, error)
action func(action string) (kamereon.Response, error)
Expand All @@ -26,6 +31,9 @@ func NewProvider(api *kamereon.API, accountID, vin string, alternativeWakeup boo
cockpitG: provider.Cached(func() (kamereon.Response, error) {
return api.Cockpit(accountID, vin)
}, cache),
hvacG: provider.Cached(func() (kamereon.Response, error) {
return api.Hvac(accountID, vin)
}, cache),
wakeup: func() (kamereon.Response, error) {
if alternativeWakeup {
return api.Action(accountID, kamereon.ActionStart, vin)
Expand Down Expand Up @@ -125,6 +133,30 @@ func (v *Provider) FinishTime() (time.Time, error) {
return time.Time{}, err
}

var _ api.VehicleClimater = (*Provider)(nil)

// Climater implements the api.VehicleClimater interface
func (v *Provider) Climater() (bool, error) {
res, err := v.hvacG()

// Zoe Ph2, Megane e-tech
if err, ok := err.(request.StatusError); ok && err.HasStatus(http.StatusForbidden, http.StatusNotFound, http.StatusBadGateway) {
return false, api.ErrNotAvailable
}

if err == nil {
state := strings.ToLower(res.Data.Attributes.HvacStatus)
if state == "" {
return false, api.ErrNotAvailable
}

active := !slices.Contains([]string{"off", "false", "invalid", "error"}, state)
return active, nil
}

return false, err
}

var _ api.Resurrector = (*Provider)(nil)

// WakeUp implements the api.Resurrector interface
Expand Down

0 comments on commit 3c2ec09

Please sign in to comment.