From ae29c0d394ef81855790d1e4b798c647e43996dc Mon Sep 17 00:00:00 2001 From: andig Date: Fri, 13 Aug 2021 07:54:36 +0200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=98t=20error=20on=20empty=20rfid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- charger/go-e.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/charger/go-e.go b/charger/go-e.go index 31f34d5cd..9021ba710 100644 --- a/charger/go-e.go +++ b/charger/go-e.go @@ -47,8 +47,8 @@ type goeStatusResponse struct { Rn1 string `json:"rn1"` // RFID 10 } -func (g goeStatusResponse) RFIDName(id int) string { - switch id { +func (g goeStatusResponse) RFIDName() string { + switch g.Uby { case 1: return g.Rna case 2: @@ -285,8 +285,5 @@ var _ api.Identifier = (*GoE)(nil) // Identify implements the api.Identifier interface func (c *GoE) Identify() (string, error) { status, err := c.apiStatus() - if status.Uby == 0 { - return "", api.ErrNotAvailable - } - return status.RFIDName(status.Uby), err + return status.RFIDName(), err }