Versicharge: add mA regulation (#28173)
This commit is contained in:
parent
dba93a9212
commit
29cab7546a
2 changed files with 13 additions and 3 deletions
|
|
@ -127,13 +127,22 @@ func (wb *Versicharge) Enable(enable bool) error {
|
|||
|
||||
// MaxCurrent implements the api.Charger interface
|
||||
func (wb *Versicharge) MaxCurrent(current int64) error {
|
||||
return wb.MaxCurrentMillis(float64(current))
|
||||
}
|
||||
|
||||
var _ api.ChargerEx = (*Versicharge)(nil)
|
||||
|
||||
// MaxCurrentMillis implements the api.ChargerEx interface
|
||||
func (wb *Versicharge) MaxCurrentMillis(current float64) error {
|
||||
if current < 6 {
|
||||
return fmt.Errorf("invalid current %d", current)
|
||||
return fmt.Errorf("invalid current %.1f", current)
|
||||
}
|
||||
|
||||
_, err := wb.conn.WriteSingleRegister(versiRegMaxCurrent, uint16(current))
|
||||
curr := uint16(current * 100)
|
||||
|
||||
_, err := wb.conn.WriteSingleRegister(versiRegMaxCurrent, curr)
|
||||
if err == nil {
|
||||
wb.current = uint16(current)
|
||||
wb.current = curr
|
||||
}
|
||||
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ products:
|
|||
- brand: Siemens
|
||||
description:
|
||||
generic: Versicharge GEN3
|
||||
capabilities: ["mA"]
|
||||
requirements:
|
||||
evcc: ["sponsorship"]
|
||||
description:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue