Skip to content
This repository has been archived by the owner on Jun 29, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/v0.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
DerAndereAndi committed Apr 26, 2023
2 parents 0a984bb + 90a49bd commit 2839324
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions emobility/public.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ func (e *EMobilityImpl) EVConnected() bool {
}

// getting currents measurements should work
if _, err := e.EVCurrentsPerPhase(); err != nil {
if _, err := e.EVCurrentsPerPhase(); err != nil && err != features.ErrDataNotAvailable {
// features.ErrDataNotAvailable check in case of measurements not being provided but the feature works
return false
}

// getting limits should work
if _, err := e.EVLoadControlObligationLimits(); err != nil {
if _, err := e.EVLoadControlObligationLimits(); err != nil && err != features.ErrDataNotAvailable {
// features.ErrDataNotAvailable check in case of load control limits not being provided but the feature works
return false
}

Expand Down Expand Up @@ -314,11 +316,20 @@ func (e *EMobilityImpl) EVLoadControlObligationLimits() ([]float64, error) {
return nil, features.ErrDataNotAvailable
}

var limitValue float64
if limitIdData.Value == nil {
return nil, features.ErrDataNotAvailable
// assume maximum possible
_, dataMax, _, err := e.evElectricalConnection.GetLimitsForParameterId(*elParamDesc.ParameterId)
if err != nil {
return nil, features.ErrDataNotAvailable
}

limitValue = dataMax
} else {
limitValue = limitIdData.Value.GetValue()
}

result = append(result, limitIdData.Value.GetValue())
result = append(result, limitValue)
}

return result, nil
Expand Down

0 comments on commit 2839324

Please sign in to comment.