Skip to content

Commit

Permalink
feat: add method to update the token (#150)
Browse files Browse the repository at this point in the history
When your token is invalid, methods like "sendKey" will ask permission on your TV again and send back a new token (on success) in the response (WSData).
There should be a way to update the token on your current Samsung instance when a new token was received.
(Otherwise it will keep on asking again for permission after executing a new sendKey.)
  • Loading branch information
dylancom authored Mar 1, 2021
1 parent 3fb164f commit 04f75c3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/samsung.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ class Samsung {
})
})
}

public setToken(token: string) {
this.TOKEN = token
this.WS_URL = this._getWSUrl()
}

public sendKey(
key: KEYS,
Expand Down

0 comments on commit 04f75c3

Please sign in to comment.