NRGConnect: include enabled status when updating maxcurrent

This commit is contained in:
andig 2023-01-26 11:44:52 +01:00
parent 91d6de46cc
commit 32f69a0154
2 changed files with 5 additions and 2 deletions

View file

@ -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

View file

@ -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),
},