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.18.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 283a619 commit 53815ae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 46 deletions.
49 changes: 5 additions & 44 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,6 @@
## Changelog for v0.17.0
## Changelog for v0.18.0

- 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())
}
}
```
- Fixed all known typos in the codebase
- This release is required because some typos were located inside error "`ENUMS`"
- This is a significant change and should be made public.
- Because of the above facts, this release exists
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version := 0.17.0
version := 0.18.0

test:
go test -v -race .
Expand Down
2 changes: 1 addition & 1 deletion 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.17.0"
const Version = "0.18.0"

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

0 comments on commit 53815ae

Please sign in to comment.