Skip to content

Commit

Permalink
Fix codefactor warnings and add it to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
DerAndereAndi committed Jan 22, 2024
1 parent 3c0fef0 commit 27c0b87
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4)](https://godoc.org/github.com/enbility/eebus-go)
[![Coverage Status](https://coveralls.io/repos/github/enbility/eebus-go/badge.svg?branch=dev)](https://coveralls.io/github/enbility/eebus-go?branch=dev)
[![Go report](https://goreportcard.com/badge/github.com/enbility/eebus-go)](https://goreportcard.com/report/github.com/enbility/eebus-go)
[![CodeFactor](https://www.codefactor.io/repository/github/enbility/eebus-go/badge)](https://www.codefactor.io/repository/github/enbility/eebus-go)

This library provides a foundation for implementing [EEBUS](https://eebus.org) use cases in [go](https://golang.org). It uses the SHIP implementation [ship-go](https://github.com/enbility/ship-go) and the SPINE implementation [spine-go](https://github.com/enbility/spine-go). Both repositories started as part of this repository, before they were moved into their own separate repositories and go packages.

Expand Down
24 changes: 12 additions & 12 deletions api/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,34 +109,34 @@ func NewConfiguration(

if len(vendorCode) == 0 {
return nil, fmt.Errorf("vendorCode %s", isRequired)
} else {
configuration.vendorCode = vendorCode
}
configuration.vendorCode = vendorCode

if len(deviceBrand) == 0 {
return nil, fmt.Errorf("brand %s", isRequired)
} else {
configuration.deviceBrand = deviceBrand
}
configuration.deviceBrand = deviceBrand

if len(deviceModel) == 0 {
return nil, fmt.Errorf("model %s", isRequired)
} else {
configuration.deviceModel = deviceModel
}
configuration.deviceModel = deviceModel

if len(serialNumber) == 0 {
return nil, fmt.Errorf("serialNumber %s", isRequired)
} else {
configuration.deviceSerialNumber = serialNumber
}
configuration.deviceSerialNumber = serialNumber

if len(deviceType) == 0 {
return nil, fmt.Errorf("deviceType %s", isRequired)
} else {
configuration.deviceType = deviceType
}
configuration.deviceType = deviceType

if len(entityTypes) == 0 {
return nil, fmt.Errorf("entityTypes %s", isRequired)
} else {
configuration.entityTypes = entityTypes
}
configuration.entityTypes = entityTypes

// set default
configuration.featureSet = model.NetworkManagementFeatureSetTypeSmart

Expand Down
3 changes: 3 additions & 0 deletions features/timeseries.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ func (t *TimeSeries) GetDescriptionForType(timeSeriesType model.TimeSeriesTypeTy
// return current constraints for Time Series
func (t *TimeSeries) GetConstraints() ([]model.TimeSeriesConstraintsDataType, error) {
rData := t.featureRemote.DataCopy(model.FunctionTypeTimeSeriesConstraintsListData)

// the codefactor warning is invalid, as .(type) check can not be replaced with if then
//revive:disable-next-line
switch constraintsData := rData.(type) {
case *model.TimeSeriesConstraintsListDataType:
if constraintsData == nil {
Expand Down

0 comments on commit 27c0b87

Please sign in to comment.