forked from evcc-io/evcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Retryable feature to indicate vehicles that are temporarily offli…
…ne (evcc-io#12841)
- Loading branch information
Showing
15 changed files
with
225 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,5 @@ const ( | |
CoarseCurrent | ||
IntegratedDevice | ||
Heating | ||
Retryable | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<template> | ||
<svg :style="svgStyle" viewBox="0 0 24 24"> | ||
<path | ||
fill="currentColor" | ||
d="M6.5 20q-2.3 0-3.9-1.6T1 14.5q0-1.925 1.188-3.425T5.25 9.15q.075-.2.15-.387t.15-.413L2.1 4.9q-.275-.275-.275-.7t.275-.7q.275-.275.7-.275t.7.275l17 17q.275.275.288.688t-.288.712q-.275.275-.687.288t-.713-.263L17.15 20zm0-2h8.65L7.1 9.95q-.05.275-.075.525T7 11h-.5q-1.45 0-2.475 1.025T3 14.5q0 1.45 1.025 2.475T6.5 18m15.1.75l-1.45-1.4q.425-.35.638-.812T21 15.5q0-1.05-.725-1.775T18.5 13H17v-2q0-2.075-1.463-3.537T12 6q-.675 0-1.3.163t-1.2.512l-1.45-1.45q.875-.6 1.863-.912T12 4q2.925 0 4.963 2.038T19 11q1.725.2 2.863 1.488T23 15.5q0 .975-.375 1.813T21.6 18.75m-6.775-6.725" | ||
></path> | ||
</svg> | ||
</template> | ||
|
||
<script> | ||
import icon from "../../mixins/icon"; | ||
export default { | ||
name: "CloudOffline", | ||
mixins: [icon], | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<template> | ||
<svg :style="svgStyle" viewBox="0 0 24 24"> | ||
<path | ||
fill="currentColor" | ||
d="M6 12.05q0 1.125.425 2.188T7.75 16.2l.25.25V15q0-.425.288-.712T9 14q.425 0 .713.288T10 15v4q0 .425-.288.713T9 20H5q-.425 0-.712-.288T4 19q0-.425.288-.712T5 18h1.75l-.4-.35q-1.3-1.15-1.825-2.625T4 12.05Q4 9.7 5.2 7.787T8.425 4.85q.35-.2.738-.025t.512.575q.125.375-.012.75t-.488.575q-1.45.8-2.312 2.213T6 12.05m12-.1q0-1.125-.425-2.187T16.25 7.8L16 7.55V9q0 .425-.288.713T15 10q-.425 0-.712-.288T14 9V5q0-.425.288-.712T15 4h4q.425 0 .713.288T20 5q0 .425-.288.713T19 6h-1.75l.4.35q1.225 1.225 1.788 2.663T20 11.95q0 2.35-1.2 4.263t-3.225 2.937q-.35.2-.737.025t-.513-.575q-.125-.375.013-.75t.487-.575q1.45-.8 2.313-2.212T18 11.95" | ||
></path> | ||
</svg> | ||
</template> | ||
|
||
<script> | ||
import icon from "../../mixins/icon"; | ||
export default { | ||
name: "Sync", | ||
mixins: [icon], | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export default { | ||
props: { | ||
size: { | ||
type: String, | ||
validator: function (value) { | ||
return ["s", "m", "l", "xl"].includes(value); | ||
}, | ||
}, | ||
}, | ||
computed: { | ||
svgStyle() { | ||
const sizes = { | ||
s: "24px", | ||
m: "32px", | ||
l: "48px", | ||
xl: "64px", | ||
}; | ||
const size = sizes[this.size] || sizes.s; | ||
return { display: "block", width: size, height: size }; | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
interval: 0.1s | ||
|
||
site: | ||
title: Vehicle Error | ||
meters: | ||
grid: grid | ||
|
||
meters: | ||
- name: grid | ||
type: custom | ||
power: | ||
source: js | ||
script: | | ||
1000 | ||
- name: charger_meter | ||
type: custom | ||
power: | ||
source: js | ||
script: | | ||
500 | ||
loadpoints: | ||
- title: Carport | ||
charger: charger | ||
meter: charger_meter | ||
vehicle: broken_tesla | ||
mode: now | ||
|
||
chargers: | ||
- name: charger | ||
type: custom | ||
enable: | ||
source: js | ||
script: | ||
enabled: | ||
source: js | ||
script: | | ||
true | ||
status: | ||
source: js | ||
script: | | ||
"C" | ||
maxcurrent: | ||
source: js | ||
script: | | ||
16 | ||
vehicles: | ||
- name: broken_tesla | ||
type: template | ||
template: tesla # not optimal, since real communication with tesla server is happening | ||
title: Broken Tesla | ||
accessToken: A | ||
refreshToken: B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const { test, expect } = require("@playwright/test"); | ||
const { start, stop } = require("./evcc"); | ||
|
||
test.beforeAll(async () => { | ||
await start("vehicle-error.evcc.yaml"); | ||
}); | ||
test.afterAll(async () => { | ||
await stop(); | ||
}); | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto("/"); | ||
}); | ||
|
||
test.describe("vehicle startup error", async () => { | ||
test("broken vehicle: normal title and 'not reachable' icon", async ({ page }) => { | ||
await expect(page.getByTestId("vehicle-name")).toHaveText("Broken Tesla"); | ||
await expect(page.getByTestId("vehicle-not-reachable-icon")).toBeVisible(); | ||
}); | ||
|
||
test("guest vehicle: normal title and no icon", async ({ page }) => { | ||
// switch to offline vehicle | ||
await page.getByRole("button", { name: "Broken Tesla" }).click(); | ||
await page.getByRole("button", { name: "Guest vehicle" }).click(); | ||
|
||
await expect(page.getByTestId("vehicle-name")).toHaveText("Guest vehicle"); | ||
await expect(page.getByTestId("vehicle-not-reachable-icon")).not.toBeVisible(); | ||
}); | ||
}); |
Oops, something went wrong.