This package implements the client API for retrieving data from HMS EWON modules via their Talk2M Datamailbox.
This package should help you build applications that request data from EWON modules. At Factry, we use it to retrieve data from distributed assets such as boilers, electricity substations, etc.
A simple example, without error handling, that prints your EWON's name, id and last synchronisation date.
package main
import (
"fmt"
"net/http"
"time"
"github.com/factrylabs/go-ewon/dmweb"
)
func main() {
h := http.Client{
Timeout: 10 * time.Second,
}
n, _ := dmweb.New(&h, "accountID", "username", "password", "develeropID")
es, _ := n.GetEwons()
for _, e := range es {
fmt.Println(e.Name, e.ID, e.LastSynchroDate)
}
}
Run godoc
.
- delete
- clean
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
MIT