NRGConnect: include enabled status when updating maxcurrent
This commit is contained in:
parent
91d6de46cc
commit
32f69a0154
2 changed files with 5 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue