Skip to content

Commit 9e534cd

Browse files
committed
Fix linter warnings
1 parent 330aad8 commit 9e534cd

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

features/internal/electricalconnection.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func (e *ElectricalConnectionCommon) GetPermittedValueDataForFilter(
152152
var resultMin, resultMax, resultDefault float64
153153

154154
for _, set := range data[0].PermittedValueSet {
155-
if set.Value != nil && len(set.Value) > 0 {
155+
if len(set.Value) > 0 {
156156
resultDefault = set.Value[0].GetValue()
157157
}
158158
if set.Range != nil {
@@ -247,12 +247,12 @@ func (e *ElectricalConnectionCommon) AdjustValueToBeWithinPermittedValuesForPara
247247

248248
for _, element := range data[0].PermittedValueSet {
249249
// is a value set
250-
if element.Value != nil && len(element.Value) > 0 {
250+
if len(element.Value) > 0 {
251251
defaultValue = element.Value[0].GetValue()
252252
hasDefaultValue = true
253253
}
254254
// is a range set
255-
if element.Range != nil && len(element.Range) > 0 {
255+
if len(element.Range) > 0 {
256256
if element.Range[0].Min != nil {
257257
minValue = element.Range[0].Min.GetValue()
258258
}

usecases/cem/cevc/public_scen1.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func (e *CEVC) ChargeStrategy(entity spineapi.EntityRemoteInterface) ucapi.EVCha
3232
}
3333

3434
// without time series slots, there is no known strategy
35-
if data[0].TimeSeriesSlot == nil || len(data[0].TimeSeriesSlot) == 0 {
35+
if len(data[0].TimeSeriesSlot) == 0 {
3636
return ucapi.EVChargeStrategyTypeUnknown
3737
}
3838

usecases/cem/evcc/public.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ func (e *EVCC) ChargingPowerLimits(entity spineapi.EntityRemoteInterface) (float
245245
if dataSet[0].PermittedValueSet[0].Range[0].Max != nil {
246246
maxValue = dataSet[0].PermittedValueSet[0].Range[0].Max.GetValue()
247247
}
248-
if dataSet[0].PermittedValueSet[0].Value != nil && len(dataSet[0].PermittedValueSet[0].Value) > 0 {
248+
if len(dataSet[0].PermittedValueSet[0].Value) > 0 {
249249
standByValue = dataSet[0].PermittedValueSet[0].Value[0].GetValue()
250250
}
251251

0 commit comments

Comments
 (0)