From 25f6e1311ad217da549f373c4f8cb05d367895ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20He=C3=9F?= Date: Fri, 20 Oct 2023 19:10:53 +0200 Subject: [PATCH] Easee: poll op_mode on startup (#10403) --- charger/easee.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/charger/easee.go b/charger/easee.go index 9c5538cfe5..7b6b3966ad 100644 --- a/charger/easee.go +++ b/charger/easee.go @@ -189,6 +189,12 @@ func NewEasee(user, password, charger string, timeout time.Duration, authorize b err = os.ErrDeadlineExceeded } + if err == nil { + // poll opMode from charger as API can give outdated initial data + uri := fmt.Sprintf("%s/chargers/%s/commands/poll_chargeropmode", easee.API, c.charger) + _, err = c.Post(uri, request.JSONContent, nil) + } + return c, err }