From 3f00018817b7dc65e85f1db9448641c430ffb10d Mon Sep 17 00:00:00 2001 From: Markus Lembke Date: Mon, 31 Mar 2025 22:16:46 +0200 Subject: [PATCH] hardybarth-salia: add rfid identifier (#20255) --- charger/echarge/salia/types.go | 6 ++++++ charger/hardybarth-salia.go | 16 ++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/charger/echarge/salia/types.go b/charger/echarge/salia/types.go index 10b315906..76e15e544 100644 --- a/charger/echarge/salia/types.go +++ b/charger/echarge/salia/types.go @@ -87,4 +87,10 @@ type Port struct { EvPresent int `json:"ev_present,string"` Charging int `json:",string"` GridCurrentLimit float64 `json:"grid_current_limit,string"` + RFID struct { + Type string `json:"type"` + Available string `json:"available"` + Authorizereq string `json:"authorizereq"` + AuthorizationRequest []string `json:"authorization_request,string"` + } `json:"rfid"` } diff --git a/charger/hardybarth-salia.go b/charger/hardybarth-salia.go index 353a04c65..4895989b2 100644 --- a/charger/hardybarth-salia.go +++ b/charger/hardybarth-salia.go @@ -266,12 +266,16 @@ func (wb *Salia) currents() (float64, float64, float64, error) { return i.L1.Actual / 1e3, i.L2.Actual / 1e3, i.L3.Actual / 1e3, err } -// var _ api.Identifier = (*Salia)(nil) - -// // Identify implements the api.Identifier interface -// func (wb *Salia) Identify() (string, error) { -// return "", api.ErrNotAvailable -// } +func (wb *Salia) Identify() (string, error) { + res, err := wb.apiG.Get() + if err != nil { + return "", err + } + if req := res.Secc.Port0.RFID.AuthorizationRequest; len(req) == 2 && req[1] != "" { + return req[1], nil + } + return "", api.ErrNotAvailable +} func (wb *Salia) getPhases() (int, error) { res, err := wb.apiG.Get()