chore: use loadpoint Title() instead of Name()
This commit is contained in:
parent
80acb35d76
commit
ea381b21fc
6 changed files with 11 additions and 11 deletions
|
|
@ -108,7 +108,7 @@ type Loadpoint struct {
|
|||
sync.Mutex // guard status
|
||||
Mode api.ChargeMode `mapstructure:"mode"` // Charge mode, guarded by mutex
|
||||
|
||||
Title string `mapstructure:"title"` // UI title
|
||||
Title_ string `mapstructure:"title"` // UI title
|
||||
ConfiguredPhases int `mapstructure:"phases"` // Charger configured phase mode 0/1/3
|
||||
ChargerRef string `mapstructure:"charger"` // Charger reference
|
||||
VehicleRef string `mapstructure:"vehicle"` // Vehicle reference
|
||||
|
|
@ -540,11 +540,6 @@ func (lp *Loadpoint) applyAction(actionCfg api.ActionConfig) {
|
|||
}
|
||||
}
|
||||
|
||||
// Name returns the human-readable loadpoint title
|
||||
func (lp *Loadpoint) Name() string {
|
||||
return lp.Title
|
||||
}
|
||||
|
||||
// Prepare loadpoint configuration by adding missing helper elements
|
||||
func (lp *Loadpoint) Prepare(uiChan chan<- util.Param, pushChan chan<- push.Event, lpChan chan<- *Loadpoint) {
|
||||
lp.uiChan = uiChan
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ type Controller interface {
|
|||
|
||||
// API is the external loadpoint API
|
||||
type API interface {
|
||||
// Name returns the defined loadpoint name
|
||||
Name() string
|
||||
// Title returns the defined loadpoint title
|
||||
Title() string
|
||||
|
||||
//
|
||||
// status
|
||||
|
|
|
|||
|
|
@ -12,6 +12,11 @@ import (
|
|||
|
||||
var _ loadpoint.API = (*Loadpoint)(nil)
|
||||
|
||||
// Title returns the human-readable loadpoint title
|
||||
func (lp *Loadpoint) Title() string {
|
||||
return lp.Title_
|
||||
}
|
||||
|
||||
// GetStatus returns the charging status
|
||||
func (lp *Loadpoint) GetStatus() api.ChargeStatus {
|
||||
lp.Lock()
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ func NewSiteFromConfig(
|
|||
|
||||
if serverdb.Instance != nil {
|
||||
var err error
|
||||
if lp.db, err = db.New(lp.Title); err != nil {
|
||||
if lp.db, err = db.New(lp.Title()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -377,7 +377,7 @@ func (s *SEMP) deviceInfo(id int, lp loadpoint.API) DeviceInfo {
|
|||
res := DeviceInfo{
|
||||
Identification: Identification{
|
||||
DeviceID: s.deviceID(id),
|
||||
DeviceName: lp.Name(),
|
||||
DeviceName: lp.Title(),
|
||||
DeviceType: sempCharger,
|
||||
DeviceSerial: s.serialNumber(id),
|
||||
DeviceVendor: "github.com/evcc-io/evcc",
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ func (m *Influx) Run(loadPoints []loadpoint.API, in <-chan util.Param) {
|
|||
|
||||
tags := make(map[string]string)
|
||||
if param.Loadpoint != nil {
|
||||
tags["loadpoint"] = loadPoints[*param.Loadpoint].Name()
|
||||
tags["loadpoint"] = loadPoints[*param.Loadpoint].Title()
|
||||
tags["vehicle"] = vehicles[*param.Loadpoint]
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue