From 32f69a01544e8b2c652acb6c4cad0fa3b8ab9746 Mon Sep 17 00:00:00 2001 From: andig Date: Thu, 26 Jan 2023 11:44:52 +0100 Subject: [PATCH] NRGConnect: include enabled status when updating maxcurrent --- charger/nrg/connect/types.go | 4 ++-- charger/nrgconnect.go | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/charger/nrg/connect/types.go b/charger/nrg/connect/types.go index e30975b3d..64de4f7aa 100644 --- a/charger/nrg/connect/types.go +++ b/charger/nrg/connect/types.go @@ -19,13 +19,13 @@ type Measurements struct { // Settings is the /api/settings request/response type Settings struct { Message string `json:",omitempty"` // api message if not ok - Info Info `json:",omitempty"` + Info *Info `json:",omitempty"` Values Values } // Info is Settings.Info type Info struct { - Connected bool `json:",omitempty"` + Connected bool } // Values is Settings.Values diff --git a/charger/nrgconnect.go b/charger/nrgconnect.go index a8ab6b28e..cac4f7071 100644 --- a/charger/nrgconnect.go +++ b/charger/nrgconnect.go @@ -158,6 +158,9 @@ func (nrg *NRGKickConnect) Enable(enable bool) error { func (nrg *NRGKickConnect) MaxCurrent(current int64) error { data := connect.Settings{ Values: connect.Values{ + ChargingStatus: &connect.ChargingStatus{ + Charging: nrg.enabled, + }, ChargingCurrent: &connect.ChargingCurrent{ Value: float64(current), },