Warp: enable phase switching when Energy Manager present (#27962)

This commit is contained in:
Marcel Goerentz 2026-03-06 11:18:04 +01:00 • committed by GitHub
parent 1487d37373
commit 4d7a079eeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -103,7 +103,7 @@ func NewWarpWSFromConfig(ctx context.Context, other map[string]any) (api.Charger
// only setup phase switching methods if power manager endpoint is set
var phases func(int) error
var getPhases func() (int, error)
if w.hasFeature(warp.FeaturePhaseSwitch) && w.pm != nil {
if (w.hasFeature(warp.FeaturePhaseSwitch) || cc.EnergyManagerURI != "") && w.pm != nil {
if res, err := w.ensurePmState(); err == nil && res.ExternalControl != warp.ExternalControlDeactivated {
w.pmState = &res
phases = w.phases1p3p