Skip to content

Commit 116a560

Browse files
committed
Merge branch 'release/v0.5.0'
2 parents 1bae87b + a62a3bc commit 116a560

File tree

229 files changed

+3478
-25954
lines changed

Some content is hidden

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

229 files changed

+3478
-25954
lines changed

.github/workflows/default.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,42 @@ jobs:
1818

1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@v2
21+
uses: actions/checkout@v4
2222

2323
- name: Set up Go
24-
uses: actions/setup-go@v2
24+
uses: actions/setup-go@v5
2525
with:
26-
go-version: ^1.18
26+
go-version: ^1.21
2727

2828
- name: Build
2929
run: go build -v ./...
3030

3131
- name: Lint
32-
uses: golangci/golangci-lint-action@v3
32+
uses: golangci/golangci-lint-action@master
3333
with:
3434
version: latest
3535
skip-pkg-cache: true
3636
skip-build-cache: true
3737
args: --timeout=3m --issues-exit-code=0 ./...
3838

3939
- name: Test
40-
run: go test -race -v -coverprofile=coverage.out -covermode=atomic ./...
40+
run: go test -race -v -coverprofile=coverage_temp.out -covermode=atomic ./...
41+
42+
- name: Remove mocks and cmd from coverage
43+
run: grep -v -e "/eebus-go/mocks/" -e "/eebus-go/cmd/" coverage_temp.out > coverage.out
4144

4245
- name: Send coverage
43-
uses: shogo82148/actions-goveralls@v1
46+
uses: coverallsapp/github-action@v2
47+
with:
48+
file: coverage.out
49+
50+
- name: Run Gosec Security Scanner
51+
uses: securego/gosec@master
52+
with:
53+
# we let the report trigger content trigger a failure using the GitHub Security features.
54+
args: '-no-fail -fmt sarif -out results.sarif ./...'
55+
- name: Upload SARIF file
56+
uses: github/codeql-action/upload-sarif@v3
4457
with:
45-
path-to-profile: coverage.out
58+
# Path to SARIF file relative to the root of the repository
59+
sarif_file: results.sarif

.golangci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
run:
2+
# timeout for analysis, e.g. 30s, 5m, default is 1m
3+
timeout: 5m
4+
5+
# include test files or not, default is true
6+
tests: true
7+
8+
# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
9+
# If invoked with -mod=readonly, the go command is disallowed from the implicit
10+
# automatic updating of go.mod described above. Instead, it fails when any changes
11+
# to go.mod are needed. This setting is most useful to check that go.mod does
12+
# not need updates, such as in a continuous integration and testing system.
13+
# If invoked with -mod=vendor, the go command assumes that the vendor
14+
# directory holds the correct copies of dependencies and ignores
15+
# the dependency descriptions in go.mod.
16+
modules-download-mode: readonly
17+
18+
# output configuration options
19+
output:
20+
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
21+
formats:
22+
- format: colored-line-number
23+
24+
linters:
25+
enable:
26+
- bodyclose
27+
- errcheck
28+
- errorlint
29+
- gocheckcompilerdirectives
30+
- gochecknoinits
31+
- gochecksumtype
32+
- goconst
33+
- gofmt
34+
- gosimple
35+
- gosec
36+
- govet
37+
- nilerr
38+
- nilnil
39+
- staticcheck
40+
- typecheck
41+
- unused
42+
- whitespace
43+
44+
issues:
45+
# Excluding configuration per-path, per-linter, per-text and per-source
46+
exclude-rules:
47+
# Exclude some linters from running on tests files.
48+
- path: _test\.go
49+
linters:
50+
- errcheck
51+
- goconst
52+
- gosec
53+
54+
# checking for errors in defers seldom makes sense...
55+
- source: "^\\s*defer\\s"
56+
linters:
57+
- errcheck
58+
- staticcheck

.mockery.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
with-expecter: True
2+
inpackage: false
3+
dir: "{{ .InterfaceDir }}/../mocks"
4+
mockname: "{{.InterfaceName}}"
5+
outpkg: "mocks"
6+
filename: "{{.InterfaceName}}.go"
7+
all: True
8+
packages:
9+
github.com/enbility/eebus-go/api:
10+
github.com/enbility/eebus-go/features:

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
MIT license
22

33
Copyright (c) 2022 Andreas Linde & Timo Vogel
4+
Copyright (c) 2023-2024 Andreas Linde
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 18 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
11
# eebus-go
22

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)
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)
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=dev)](https://coveralls.io/github/enbility/eebus-go?branch=dev)
5+
[![Coverage Status](https://coveralls.io/repos/github/enbility/eebus-go/badge.svg?branch=main)](https://coveralls.io/github/enbility/eebus-go?branch=main)
66
[![Go report](https://goreportcard.com/badge/github.com/enbility/eebus-go)](https://goreportcard.com/report/github.com/enbility/eebus-go)
7+
[![CodeFactor](https://www.codefactor.io/repository/github/enbility/eebus-go/badge)](https://www.codefactor.io/repository/github/enbility/eebus-go)
78

8-
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.
9+
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.
10+
11+
Basic understanding of the EEBUS concepts SHIP and SPINE to use this library is required. Please check the corresponding specifications on the [EEBUS downloads website](https://www.eebus.org/media-downloads/).
912

1013
## Introduction
1114

1215
The supported functionality contains:
1316

14-
- Support for SHIP 1.0.1
15-
- Support for big parts of SPINE 1.1.1
16-
- (De-)serialization for EEBUS specific JSON format requirements
17+
- Support for SHIP 1.0.1 via [ship-go](https://github.com/enbility/ship-go)
18+
- Support for SPINE 1.3.0 via [spine-go](https://github.com/enbility/spine-go)
1719
- Certificate handling
18-
- mDNS Support, incl. avahi support (recommended)
20+
- mDNS Support, incl. avahi support
1921
- Connection (websocket) handling, including reconnection and double connections
2022
- Support for handling pairing of devices
2123

22-
Basic understanding of the EEBUS concepts SHIP and SPINE to use this library is required. Please check the corresponding specifications on the [EEBUS downloads website](https://www.eebus.org/media-downloads/).
24+
## Packages
2325

24-
An open source SDK written in go providing the foundation to use EEBUS in your projects. Contains support for SHIP and SPINE communication.
26+
- `api`: global API interface definitions and eebus service configuration
27+
- `features`: provides feature helpers with the local SPINE feature having the client role and the remote SPINE feature being the server for easy access to commonly used functions
28+
- `service`: central package which provides access to SHIP and SPINE. Use this to create the EEBUS service, its configuration and connect to remote EEBUS services
29+
- `util`: package with various useful helper functions
2530

2631
## Usage
2732

@@ -85,158 +90,21 @@ If no certfile or keyfile are provided, they are generated and printed in the co
8590
- Double connection handling is not implemented according to SHIP 12.2.2. Instead the connection initiated by the higher SKI will be kept. Much simpler and always works
8691
- PIN Verification is _NOT_ supported other than SHIP 13.4.4.3.5.1 _"none"_ PIN state is supported!
8792
- Access Methods SHIP 13.4.6 only supports the most basic scenario and only works after PIN verification state is completed.
93+
- Supported registration mechanisms (SHIP 5):
94+
- auto accept (without any interaction mechanism!)
95+
- user verification
8896

8997
This approach has been tested with:
9098

9199
- Elli Charger Connect
92100
- Porsche Mobile Charger Connect
93101
- SMA Home Energy Manager 2.0
94102

95-
## Roadmap - Spine specification implementation
96-
97-
### General request processing
98-
99-
- [X] Request and process full data
100-
- [ ] Request partial data
101-
- [ ] Delete Selectors
102-
- [ ] Update Selectors
103-
- [ ] Elements
104-
- [ ] Send
105-
- [X] Full data
106-
- [ ] Partial data
107-
- [X] Process partial data
108-
- [X] Delete Selectors
109-
- [X] Update Selectors
110-
- [X] Elements
111-
- [ ] Request types
112-
- [X] Read
113-
- [ ] Send
114-
- [X] Full Request
115-
- [ ] Partial Request
116-
- [ ] Partial Delete
117-
- [X] Receive
118-
- [X] Full Request
119-
- [X] Partial Request
120-
- [X] Partial Delete
121-
- [X] Reply
122-
- [ ] Send
123-
- [X] Full Request
124-
- [ ] Partial Request
125-
- [ ] Partial Delete
126-
- [X] Receive
127-
- [X] Full Request
128-
- [X] Partial Request
129-
- [X] Partial Delete
130-
- [X] Notify
131-
- [ ] Send
132-
- [X] Full Request
133-
- [ ] Partial Request
134-
- [ ] Partial Delete
135-
- [X] Receive
136-
- [X] Full Request
137-
- [X] Partial Request
138-
- [X] Partial Delete
139-
- [X] Write
140-
- [ ] Send
141-
- [X] Full Request
142-
- [ ] Partial Request
143-
- [ ] Partial Delete
144-
- [X] Receive
145-
- [X] Full Request
146-
- [X] Partial Request
147-
- [X] Partial Delete
148-
- [X] Result message handling
149-
- [X] Handle incoming error results
150-
- [X] Handle incoming success results
151-
- [X] Respond with error result when processing failed
152-
- [X] Acknowledgement support
153-
- [X] Request
154-
- [X] Respond
155-
- [x] Use maximum response delay to timeout requests
156-
157-
### Node Management
158-
159-
- [ ] Detailed Discovery
160-
- [ ] Read Messages
161-
- [ ] Send
162-
- [X] Full Request
163-
- [ ] Partial Request
164-
- [X] Receive
165-
- [X] Full Request
166-
- [X] Partial Request
167-
- [ ] Reply Messages
168-
- [ ] Send
169-
- [X] Full Request
170-
- [ ] Partial Request
171-
- [X] Receive
172-
- [X] Full Request
173-
- [X] Partial Request
174-
- [ ] Notify Messages
175-
- [ ] Send
176-
- [X] Full Request
177-
- [ ] Partial Request
178-
- [X] Receive
179-
- [X] Full Request
180-
- [X] Partial Request
181-
- [ ] Destination List
182-
- [ ] Request and process full data
183-
- [X] Response full data
184-
- [ ] Request and process partial data
185-
- [ ] Response partial data
186-
- [ ] Notify subscribers
187-
- [ ] Binding
188-
- [ ] Send Requests
189-
- [X] Add Binding
190-
- [ ] Delete Binding
191-
- [X] Receive Requests
192-
- [X] Add Binding
193-
- [X] Delete Binding
194-
- [ ] Subscription
195-
- [ ] Send Requests
196-
- [X] Add Subscription
197-
- [ ] Delete Subscription
198-
- [X] Receive Requests
199-
- [X] Add Subscription
200-
- [X] Delete Subscription
201-
- [X] Notify subscribers
202-
- [ ] Use Case Discovery
203-
- [ ] Read Messages
204-
- [ ] Send
205-
- [X] Full Request
206-
- [ ] Partial Request
207-
- [X] Receive
208-
- [X] Full Request
209-
- [X] Partial Request
210-
- [ ] Reply Messages
211-
- [ ] Send
212-
- [X] Full Request
213-
- [ ] Partial Request
214-
- [X] Receive
215-
- [X] Full Request
216-
- [X] Partial Request
217-
- [ ] Notify Messages
218-
- [ ] Send
219-
- [X] Full Request
220-
- [ ] Partial Request
221-
- [X] Receive
222-
- [X] Full Request
223-
- [X] Partial Request
224-
225-
### General feature implementation
226-
227-
- [ ] Hearbeat Support
228-
- [X] Send hearbeats
229-
- [ ] Receive hearbeats
230-
231-
### Partial, selector, elements support
232-
233-
All list types do support processing of incoming partial messages, including selectors and elements. Sending partial messages is possible but there is no special support implemented right now.
234-
235103
## Interfaces
236104

237105
### Verbose logging
238106

239-
Use `SetLogger` on `Service` to set the logger which needs to conform to the `logging.Logging` interface.
107+
Use `SetLogger` on `Service` to set the logger which needs to conform to the `logging.Logging` interface of [ship-go](https://github.com/enbility/ship-go).
240108

241109
Example:
242110

0 commit comments

Comments
 (0)