Daheimladen: add mA current control (#21908)

This commit is contained in:
andig 2025-06-18 19:52:07 +02:00 • committed by GitHub
parent 30925be560
commit 60fded77c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 2 deletions

View file

@ -208,11 +208,19 @@ func (wb *DaheimLadenMB) Enable(enable bool) error {
// MaxCurrent implements the api.Charger interface
func (wb *DaheimLadenMB) MaxCurrent(current int64) error {
return wb.MaxCurrentMillis(float64(current))
}
var _ api.ChargerEx = (*DaheimLadenMB)(nil)
// MaxCurrentMillis implements the api.ChargerEx interface
func (wb *DaheimLadenMB) MaxCurrentMillis(current float64) error {
if current < 6 {
return fmt.Errorf("invalid current %d", current)
return fmt.Errorf("invalid current %.1f", current)
}
curr := uint16(current * 10)
err := wb.setCurrent(curr)
if err == nil {
wb.curr = curr

View file

@ -7,6 +7,7 @@ requirements:
description:
de: Die Wallbox muss über eine aktuelle Firmware mit Modbus-Unterstützung verfügen. In den Einstellungen muss "Nachladen" (Smart) bzw. "RSDA" (Touch) aktiviert sein
en: Wallbox must be operated with a recent firmware including Modbus support. Furthermore, “Nachladen” (Smart) or “RSDA” (Touch) must be activated in settings.
capabilities: ["mA"]
params:
- name: host
- name: port

View file

@ -3,7 +3,7 @@ products:
- brand: DaheimLaden
description:
generic: Pro
capabilities: ["1p3p"]
capabilities: ["1p3p", "mA"]
params:
- name: host
- name: port