effectiveMaxCurrent returns the effective max current
()
| 173 | |
| 174 | // effectiveMaxCurrent returns the effective max current |
| 175 | func (lp *Loadpoint) effectiveMaxCurrent() float64 { |
| 176 | maxCurrent := lp.getMaxCurrent() |
| 177 | |
| 178 | if v := lp.GetVehicle(); v != nil { |
| 179 | if res, ok := v.OnIdentified().GetMaxCurrent(); ok && res > 0 { |
| 180 | maxCurrent = min(maxCurrent, res) |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | if c, ok := api.Cap[api.CurrentLimiter](lp.charger); ok { |
| 185 | if _, res, err := c.GetMinMaxCurrent(); err == nil && res > 0 { |
| 186 | maxCurrent = min(maxCurrent, res) |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | return maxCurrent |
| 191 | } |
| 192 | |
| 193 | // EffectiveLimitSoc returns the effective session limit soc |
| 194 | func (lp *Loadpoint) EffectiveLimitSoc() int { |