Skip to content
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

Support chargers without vehicle #6316

Merged
merged 8 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Split charger icon
  • Loading branch information
andig committed Feb 20, 2023
commit 0b5a9758f941cd63fa66bf0d9050b46784c55150
4 changes: 4 additions & 0 deletions assets/js/components/Loadpoint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<div class="d-block d-sm-flex justify-content-between align-items-center mb-3">
<div class="d-flex justify-content-between align-items-center mb-3 text-truncate">
<h3 class="me-2 mb-0 text-truncate">
<VehicleIcon :name="chargerIcon" class="me-2 flex-shrink-0" />
{{ title || $t("main.loadpoint.fallbackName") }}
</h3>
<LoadpointSettingsButton
Expand Down Expand Up @@ -114,6 +115,7 @@ import formatter from "../mixins/formatter";
import collector from "../mixins/collector";
import LoadpointSettingsButton from "./LoadpointSettingsButton.vue";
import LoadpointSettingsModal from "./LoadpointSettingsModal.vue";
import VehicleIcon from "./VehicleIcon";

export default {
name: "Loadpoint",
Expand All @@ -124,6 +126,7 @@ export default {
LabelAndValue,
LoadpointSettingsButton,
LoadpointSettingsModal,
VehicleIcon,
},
mixins: [formatter, collector],
props: {
Expand All @@ -142,6 +145,7 @@ export default {

// charger
chargerFeatureFixedConnection: Boolean,
chargerIcon: String,

// vehicle
connected: Boolean,
Expand Down
19 changes: 10 additions & 9 deletions core/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ const (
phasesEnabled = "phasesEnabled" // enabled phases (1/3)
phasesActive = "phasesActive" // active phases as used by vehicle (1/2/3)

vehicleDetectionActive = "vehicleDetectionActive" // vehicle detection is active (bool)
chargerIcon = "chargerIcon" // charger icon for ui

vehicleOdometer = "vehicleOdometer" // vehicle odometer
vehicleRange = "vehicleRange" // vehicle range
vehicleSoc = "vehicleSoc" // vehicle soc
vehicleTargetSoc = "vehicleTargetSoc" // vehicle soc limit
vehicleCapacity = "vehicleCapacity" // vehicle battery capacity
vehicleIcon = "vehicleIcon" // vehicle icon for ui
vehiclePresent = "vehiclePresent" // vehicle detected
vehicleTitle = "vehicleTitle" // vehicle title
vehicleCapacity = "vehicleCapacity" // vehicle battery capacity
vehicleDetectionActive = "vehicleDetectionActive" // vehicle detection active
vehicleIcon = "vehicleIcon" // vehicle icon for ui
vehicleOdometer = "vehicleOdometer" // vehicle odometer
vehiclePresent = "vehiclePresent" // vehicle detected
vehicleRange = "vehicleRange" // vehicle range
vehicleSoc = "vehicleSoc" // vehicle soc
vehicleTargetSoc = "vehicleTargetSoc" // vehicle soc limit
vehicleTitle = "vehicleTitle" // vehicle title

minCurrent = "minCurrent" // charger min current
maxCurrent = "maxCurrent" // charger max current
Expand Down
4 changes: 3 additions & 1 deletion core/loadpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,9 @@ func (lp *Loadpoint) Prepare(uiChan chan<- util.Param, pushChan chan<- push.Even

// charger icon
if c, ok := lp.charger.(api.IconDescriber); ok {
lp.publish(vehicleIcon, c.Icon())
lp.publish(chargerIcon, c.Icon())
} else {
lp.publish(chargerIcon, nil)
}

// assign and publish default vehicle
Expand Down