chore: simplify

This commit is contained in:
andig 2026-07-05 18:34:04 +02:00
parent 7c2df58765
commit 823e194647

View file

@ -157,8 +157,10 @@ func (v *Provider) Status() (api.ChargeStatus, error) {
// block 2: flat charging_state field and the current_charge_state field
if p := lookup(data, FieldChargingState, FieldCurrentChargeState); p != nil &&
(strings.EqualFold(p.Value, "charging") || strings.Contains(strings.ToUpper(p.Value), "CHARGING_HV") ||
strings.EqualFold(p.Value, "conservationCharging") || strings.EqualFold(p.Value, "CHARGE_STATE_CONSERVATION_CHARGING")) {
(strings.Contains(strings.ToUpper(p.Value), "CHARGING_HV") ||
strings.EqualFold(p.Value, "charging") ||
strings.EqualFold(p.Value, "conservationCharging") ||
strings.EqualFold(p.Value, "CHARGE_STATE_CONSERVATION_CHARGING")) {
status = api.StatusC
}