diff --git a/api/api.go b/api/api.go index 7047b92fc..6f2da0ea5 100644 --- a/api/api.go +++ b/api/api.go @@ -137,9 +137,9 @@ type Authorizer interface { type Vehicle interface { Battery BatteryCapacity + IconDescriber Title() string SetTitle(string) - Icon() string Phases() int Identifiers() []string OnIdentified() ActionConfig @@ -210,10 +210,14 @@ type AuthProvider interface { LogoutHandler() http.HandlerFunc } +// IconDescriber optionally provides an icon +type IconDescriber interface { + Icon() string +} + // FeatureDescriber optionally provides a list of supported non-api features type FeatureDescriber interface { Features() []Feature - Has(Feature) bool } // CsvWriter converts to csv diff --git a/api/feature.go b/api/feature.go index 788051860..76aa8d799 100644 --- a/api/feature.go +++ b/api/feature.go @@ -15,4 +15,5 @@ const ( _ Feature = iota Offline CoarseCurrent + IntegratedDevice ) diff --git a/api/feature_enumer.go b/api/feature_enumer.go index 0beaac830..362ffa377 100644 --- a/api/feature_enumer.go +++ b/api/feature_enumer.go @@ -7,11 +7,11 @@ import ( "strings" ) -const _FeatureName = "OfflineCoarseCurrent" +const _FeatureName = "OfflineCoarseCurrentIntegratedDevice" -var _FeatureIndex = [...]uint8{0, 7, 20} +var _FeatureIndex = [...]uint8{0, 7, 20, 36} -const _FeatureLowerName = "offlinecoarsecurrent" +const _FeatureLowerName = "offlinecoarsecurrentintegrateddevice" func (i Feature) String() string { i -= 1 @@ -27,20 +27,24 @@ func _FeatureNoOp() { var x [1]struct{} _ = x[Offline-(1)] _ = x[CoarseCurrent-(2)] + _ = x[IntegratedDevice-(3)] } -var _FeatureValues = []Feature{Offline, CoarseCurrent} +var _FeatureValues = []Feature{Offline, CoarseCurrent, IntegratedDevice} var _FeatureNameToValueMap = map[string]Feature{ - _FeatureName[0:7]: Offline, - _FeatureLowerName[0:7]: Offline, - _FeatureName[7:20]: CoarseCurrent, - _FeatureLowerName[7:20]: CoarseCurrent, + _FeatureName[0:7]: Offline, + _FeatureLowerName[0:7]: Offline, + _FeatureName[7:20]: CoarseCurrent, + _FeatureLowerName[7:20]: CoarseCurrent, + _FeatureName[20:36]: IntegratedDevice, + _FeatureLowerName[20:36]: IntegratedDevice, } var _FeatureNames = []string{ _FeatureName[0:7], _FeatureName[7:20], + _FeatureName[20:36], } // FeatureString retrieves an enum value from the enum constants string name. diff --git a/assets/js/components/Loadpoint.story.vue b/assets/js/components/Loadpoint.story.vue index 3a6ed68b3..bb510f59c 100644 --- a/assets/js/components/Loadpoint.story.vue +++ b/assets/js/components/Loadpoint.story.vue @@ -54,5 +54,14 @@ const state = reactive({ :chargePower="0" /> + + + diff --git a/assets/js/components/Loadpoint.vue b/assets/js/components/Loadpoint.vue index 72bbbba64..29f10911e 100644 --- a/assets/js/components/Loadpoint.vue +++ b/assets/js/components/Loadpoint.vue @@ -1,9 +1,16 @@