Skip to content
This repository has been archived by the owner on Oct 31, 2022. It is now read-only.

Commit

Permalink
Bump version to 0.17.0, write CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MikMuellerDev committed Aug 9, 2022
1 parent dc090b8 commit 65542d2
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 5 deletions.
46 changes: 44 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
## Changelog for v0.16.0
## Changelog for v0.17.0

- Added HMS job count to debug info
- Added support for `token` authentication
- Completely refactored the way login and connection works
- Now compatible with Smarthome user authentication tokens and server version `0.0.54`

### Example Code
This code demonstrates the use and difference of the new authentication methods
```go
package main

import "github.com/smarthome-go/sdk"

const URL = "http://localhost:8082"

func main() {
// === Example 1: Using token authentication === //
c1, err := sdk.NewConnection(URL, sdk.AuthMethodQueryToken /* sdk.AuthMethodCookieToken */)
if err != nil {
panic(err.Error())
}
// Login with your user authentication token, to obtain one, visit `http://your-smarthome.box/profile`
if err := c1.TokenLogin("650feaafc1487d18bd8c5a805363be96"); err != nil {
panic(err.Error())
}

// === Example 2: Using username & password authentication === //
c2, err := sdk.NewConnection(URL, sdk.AuthMethodQueryPassword /* sdk.AuthMethodCookiePassword */)
if err != nil {
panic(err.Error())
}
// Login with the usual username-password combination
if err := c1.UserLogin("admin", "admin"); err != nil {
panic(err.Error())
}

// => After login, each connection behaves idenically
if err := c1.SetPower("s2", true); err != nil {
panic(err.Error())
}
if err := c2.SetPower("s2", true); err != nil {
panic(err.Error())
}
}
```
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version := 0.16.0
version := 0.17.0

test:
go test -v -race .
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package sdk

// Specifies the SDK version
const Version = "0.16.0"
const Version = "0.17.0"

// Specifies the oldest Smarthome version this SDK can connect to
const MinSmarthomeVersion = "0.0.50"
const MinSmarthomeVersion = "0.0.54"

0 comments on commit 65542d2

Please sign in to comment.