Skip to content

Commit 5a35d85

Browse files
committed
Merge branch 'release/v0.2.0'
2 parents 325ff50 + 3f7399c commit 5a35d85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1820
-1587
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# eebus-go
22

3-
[![Build Status](https://github.com/enbility/eebus-go/actions/workflows/default.yml/badge.svg?branch=main)](https://github.com/enbility/eebus-go/actions/workflows/default.yml/badge.svg?branch=main)
3+
[![Build Status](https://github.com/enbility/eebus-go/actions/workflows/default.yml/badge.svg?branch=dev)](https://github.com/enbility/eebus-go/actions/workflows/default.yml/badge.svg?branch=dev)
44
[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4)](https://godoc.org/github.com/enbility/eebus-go)
5-
[![Coverage Status](https://coveralls.io/repos/github/enbility/eebus-go/badge.svg?branch=main)](https://coveralls.io/github/enbility/eebus-go?branch=main)
5+
[![Coverage Status](https://coveralls.io/repos/github/enbility/eebus-go/badge.svg?branch=dev)](https://coveralls.io/github/enbility/eebus-go?branch=dev)
66
[![Go report](https://goreportcard.com/badge/github.com/enbility/eebus-go)](https://goreportcard.com/report/github.com/enbility/eebus-go)
77

88
This library provides a complete foundation for implementing [EEBUS](https://eebus.org) use cases. The use cases define various functional scenarios for different device categories, e.g. energy management systems, charging stations, heat pumps, and more.

features/deviceclassification.go

Lines changed: 4 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,6 @@ import (
55
"github.com/enbility/eebus-go/spine/model"
66
)
77

8-
type ManufacturerType struct {
9-
BrandName string
10-
VendorName string
11-
VendorCode string
12-
DeviceName string
13-
DeviceCode string
14-
SerialNumber string
15-
SoftwareRevision string
16-
HardwareRevision string
17-
PowerSource string
18-
ManufacturerNodeIdentification string
19-
ManufacturerLabel string
20-
ManufacturerDescription string
21-
}
22-
238
type DeviceClassification struct {
249
*FeatureImpl
2510
}
@@ -38,22 +23,12 @@ func NewDeviceClassification(localRole, remoteRole model.RoleType, spineLocalDev
3823
}
3924

4025
// request DeviceClassificationManufacturerData from a remote device entity
41-
func (d *DeviceClassification) RequestManufacturerDetailsForEntity() (*model.MsgCounterType, error) {
42-
// request DeviceClassificationManufacturer from a remote entity
43-
msgCounter, err := d.requestData(model.FunctionTypeDeviceClassificationManufacturerData, nil, nil)
44-
if err != nil {
45-
return nil, err
46-
}
47-
48-
return msgCounter, nil
26+
func (d *DeviceClassification) RequestManufacturerDetails() (*model.MsgCounterType, error) {
27+
return d.requestData(model.FunctionTypeDeviceClassificationManufacturerData, nil, nil)
4928
}
5029

5130
// get the current manufacturer details for a remote device entity
52-
func (d *DeviceClassification) GetManufacturerDetails() (*ManufacturerType, error) {
53-
if d.featureRemote == nil {
54-
return nil, ErrDataNotAvailable
55-
}
56-
31+
func (d *DeviceClassification) GetManufacturerDetails() (*model.DeviceClassificationManufacturerDataType, error) {
5732
rData := d.featureRemote.Data(model.FunctionTypeDeviceClassificationManufacturerData)
5833
if rData == nil {
5934
return nil, ErrDataNotAvailable
@@ -64,44 +39,5 @@ func (d *DeviceClassification) GetManufacturerDetails() (*ManufacturerType, erro
6439
return nil, ErrDataNotAvailable
6540
}
6641

67-
details := &ManufacturerType{}
68-
69-
if data.BrandName != nil {
70-
details.BrandName = string(*data.BrandName)
71-
}
72-
if data.VendorName != nil {
73-
details.VendorName = string(*data.VendorName)
74-
}
75-
if data.VendorCode != nil {
76-
details.VendorCode = string(*data.VendorCode)
77-
}
78-
if data.DeviceName != nil {
79-
details.DeviceName = string(*data.DeviceName)
80-
}
81-
if data.DeviceCode != nil {
82-
details.DeviceCode = string(*data.DeviceCode)
83-
}
84-
if data.SerialNumber != nil {
85-
details.SerialNumber = string(*data.SerialNumber)
86-
}
87-
if data.SoftwareRevision != nil {
88-
details.SoftwareRevision = string(*data.SoftwareRevision)
89-
}
90-
if data.HardwareRevision != nil {
91-
details.HardwareRevision = string(*data.HardwareRevision)
92-
}
93-
if data.PowerSource != nil {
94-
details.PowerSource = string(*data.PowerSource)
95-
}
96-
if data.ManufacturerNodeIdentification != nil {
97-
details.ManufacturerNodeIdentification = string(*data.ManufacturerNodeIdentification)
98-
}
99-
if data.ManufacturerLabel != nil {
100-
details.ManufacturerLabel = string(*data.ManufacturerLabel)
101-
}
102-
if data.ManufacturerDescription != nil {
103-
details.ManufacturerDescription = string(*data.ManufacturerDescription)
104-
}
105-
106-
return details, nil
42+
return data, nil
10743
}

features/deviceclassification_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ func (s *DeviceClassificationSuite) BeforeTest(suiteName, testName string) {
5050
assert.NotNil(s.T(), s.deviceClassification)
5151
}
5252

53-
func (s *DeviceClassificationSuite) Test_RequestManufacturerDetailsForEntity() {
54-
counter, err := s.deviceClassification.RequestManufacturerDetailsForEntity()
53+
func (s *DeviceClassificationSuite) Test_RequestManufacturerDetails() {
54+
counter, err := s.deviceClassification.RequestManufacturerDetails()
5555
assert.Nil(s.T(), err)
5656
assert.NotNil(s.T(), counter)
5757
}

0 commit comments

Comments
 (0)