-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Mode Redesign: rename pv to smart, replace minpv with always charge (BC) #32490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
naltatis
wants to merge
22
commits into
master
Choose a base branch
from
feat/smart-mode
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,644
−301
Open
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
a4c591d
Charge modes: rename pv to smart, replace minpv with always charge
naltatis 8699eba
chore: regenerate openapi artifacts
naltatis c6ed6f8
chore: regenerate mcp openapi docs
naltatis e6cc34e
UI: generalize once icon naming
naltatis a221778
UI: reword always charge subline to no interruptions
naltatis 8681a6f
Merge branch 'master' into feat/smart-mode
Copilot 6bea14d
Config: fix device-specific comment typo
Copilot 888f9fc
UI: keep loadpoint files formatted
Copilot d57936b
Merge branch 'master' into feat/smart-mode
naltatis 49442ce
Merge remote-tracking branch 'origin/master' into feat/smart-mode
naltatis b1ff837
Config UI: device-specific mode labels for heating loadpoints
naltatis c651263
Merge remote-tracking branch 'origin/master' into feat/smart-mode
naltatis 5d3ea4e
Optimizer: restore always charge min power floor
naltatis 957d00c
Vehicles: per-vehicle always charge default
naltatis ea1cd97
Loadpoint: read always charge under lock
naltatis 54d953e
Schema: replace legacy charge modes with smart
naltatis dec8cb3
Docs: update charge mode references
naltatis 00acb5b
Loadpoint: gate legacy minpv migration on current control
naltatis 8f72c94
Loadpoint: normalize legacy default mode to smart
naltatis 0596d0f
Dist config: smart mode wording
naltatis a83651a
Merge branch 'master' into feat/smart-mode
naltatis 3d4b81f
Vehicles: simplify always charge handler
naltatis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
151 changes: 151 additions & 0 deletions
151
assets/js/components/Loadpoints/AlwaysChargeDropdown.vue
This file contains hidden or 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,151 @@ | ||
| <template> | ||
| <div class="panel" data-testid="always-charge-dropdown"> | ||
| <div class="d-flex align-items-center gap-3"> | ||
| <AlwaysChargeIcon class="icon flex-shrink-0" :class="{ active: isActive }" /> | ||
| <div class="flex-grow-1 overflow-hidden"> | ||
| <div class="fw-bold text-truncate">{{ $t("main.alwaysCharge.label") }}</div> | ||
| <div class="subline" :class="{ hint: !!hint }">{{ subline }}</div> | ||
| </div> | ||
| <div class="d-flex align-items-center gap-2 flex-shrink-0"> | ||
| <button | ||
| type="button" | ||
| class="once-badge" | ||
| :class="{ active: isOnce }" | ||
| :title="$t('main.alwaysCharge.onceTip')" | ||
| :aria-label="$t('main.alwaysCharge.onceTip')" | ||
| :aria-pressed="isOnce" | ||
| @click="toggleOnce" | ||
| > | ||
| <OnceIcon :filled="isOnce" /> | ||
| </button> | ||
| <div class="form-check form-switch m-0"> | ||
| <input | ||
| class="form-check-input" | ||
| type="checkbox" | ||
| role="switch" | ||
| :checked="isActive" | ||
| :aria-label="$t('main.alwaysCharge.label')" | ||
| @change="toggle" | ||
| /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script lang="ts"> | ||
| import { defineComponent } from "vue"; | ||
| import { ALWAYS_CHARGE, type Timeout } from "@/types/evcc"; | ||
| import AlwaysChargeIcon from "../MaterialIcon/AlwaysCharge.vue"; | ||
| import OnceIcon from "../MaterialIcon/Once.vue"; | ||
| import formatter from "@/mixins/formatter"; | ||
|
|
||
| const { OFF, ON, ONCE } = ALWAYS_CHARGE; | ||
|
|
||
| export default defineComponent({ | ||
| name: "AlwaysChargeDropdown", | ||
| components: { AlwaysChargeIcon, OnceIcon }, | ||
| mixins: [formatter], | ||
| props: { | ||
| alwaysCharge: { type: String, default: OFF }, | ||
| minCurrent: { type: Number, default: 0 }, | ||
| }, | ||
| emits: ["updated"], | ||
| data() { | ||
| return { | ||
| hint: null as "once" | "permanent" | null, | ||
| timeout: null as Timeout | null, | ||
| }; | ||
| }, | ||
| computed: { | ||
| isActive() { | ||
| return this.alwaysCharge === ON || this.alwaysCharge === ONCE; | ||
| }, | ||
| isOnce() { | ||
| return this.alwaysCharge === ONCE; | ||
| }, | ||
| subline() { | ||
| if (this.hint) { | ||
| return this.$t(`main.alwaysCharge.${this.hint}`); | ||
| } | ||
| return this.$t("main.alwaysCharge.description", { | ||
| current: this.fmtNumber(this.minCurrent, this.minCurrent % 1 ? 1 : 0), | ||
| }); | ||
| }, | ||
| }, | ||
| unmounted() { | ||
| this.clearHint(); | ||
| }, | ||
| methods: { | ||
| toggle() { | ||
| this.clearHint(); | ||
| this.$emit("updated", this.isActive ? OFF : ON); | ||
| }, | ||
| toggleOnce() { | ||
| const newValue = this.isOnce ? ON : ONCE; | ||
| // briefly explain the new scope, then revert to the regular description | ||
| this.showHint(newValue === ONCE ? "once" : "permanent"); | ||
| this.$emit("updated", newValue); | ||
| }, | ||
| showHint(hint: "once" | "permanent") { | ||
| this.hint = hint; | ||
| if (this.timeout) clearTimeout(this.timeout); | ||
| this.timeout = setTimeout(() => this.clearHint(), 5000); | ||
| }, | ||
| clearHint() { | ||
| this.hint = null; | ||
| if (this.timeout) { | ||
| clearTimeout(this.timeout); | ||
| this.timeout = null; | ||
| } | ||
| }, | ||
| }, | ||
| }); | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .panel { | ||
| --highlight: var(--evcc-darker-green); | ||
| position: absolute; | ||
| top: calc(100% + 10px); | ||
| right: 0; | ||
| z-index: 5; | ||
| width: 320px; | ||
| max-width: calc(100vw - 2rem); | ||
| padding: 0.75rem 0.875rem; | ||
| background: var(--evcc-box); | ||
| border-radius: 1rem; | ||
| box-shadow: 0 0 8px var(--bs-gray-light); | ||
| text-align: start; | ||
| } | ||
| html.dark .panel { | ||
| /* brighter green for contrast on dark panel */ | ||
| --highlight: var(--evcc-dark-green); | ||
| } | ||
| .icon { | ||
| color: var(--evcc-gray); | ||
| } | ||
| .icon.active { | ||
| color: var(--highlight); | ||
| } | ||
| .subline { | ||
| font-size: var(--bs-body-font-size); | ||
| color: var(--evcc-gray); | ||
| } | ||
| .subline.hint { | ||
| color: var(--highlight); | ||
| } | ||
| .once-badge { | ||
| padding: 0; | ||
| color: var(--evcc-gray); | ||
| background: transparent; | ||
| border: none; | ||
| } | ||
| .once-badge.active { | ||
| color: var(--highlight); | ||
| } | ||
| .form-check-input:checked { | ||
| background-color: var(--highlight); | ||
| border-color: var(--highlight); | ||
| } | ||
| </style> |
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.