1
0
Fork 0
Go to file
Michał Rudowicz 999413ca99 Sourcehut CI 2024-03-04 20:24:50 +01:00
.github/workflows Initial commit 2021-11-19 14:15:31 +01:00
.build.yml Sourcehut CI 2024-03-04 20:24:50 +01:00
.gitignore Initial commit 2021-11-19 14:15:31 +01:00
LICENSE add license 2021-11-19 14:19:03 +01:00
README.md read me 2021-11-20 13:03:16 +01:00
change_type.go change types 2021-11-19 20:07:46 +01:00
frame.go Initial commit 2021-11-19 14:15:31 +01:00
get_name.go Device name from SATEL with error checking 2024-03-04 20:24:13 +01:00
get_name_test.go Device name from SATEL with error checking 2024-03-04 20:24:13 +01:00
go.mod Module name 2024-03-03 22:47:13 +01:00
go.sum Get device name from SATEL 2024-03-03 22:42:13 +01:00
satel.go Device name from SATEL with error checking 2024-03-04 20:24:13 +01:00
satel_test.go Initial commit 2021-11-19 14:15:31 +01:00
scanner.go Initial commit 2021-11-19 14:15:31 +01:00

README.md

go-satel

go-satel is a Go library to integrate with Satel ETHM-1/ETHM-1 Plus module

Build Go Report Card

Installation

go-satel is compatible with modern Go releases in module mode, with Go installed:

go get github.com/probakowski/go-satel

will resolve and add the package to the current development module, along with its dependencies.

Alternatively the same can be achieved if you use import in a package:

import "github.com/probakowski/go-satel"

and run go get without parameters.

Finally, to use the top-of-trunk version of this repo, use the following command:

go get github.com/probakowski/go-satel@master

Usage

s := satel.NewConfig("<ip:port>", satel.Config{EventsQueueSize: 1000})
go func() {
    value := true
    for {
        s.SetOutput("<user code>", <port number>, value)
        time.Sleep(5 * time.Second)
        value = !value
    }
}()
for e, ok := <-s.Events; ok; e, ok = <-s.Events {
    logger.Print("change from satel", "type", e.Type, "index", e.Index, "value", e.Value)
}