Skip to content

Commit

Permalink
Fix pairing check (#119)
Browse files Browse the repository at this point in the history
* Raise WebOsTvPairError if user denied pairing

* Bump version to 0.3.2
  • Loading branch information
thecode authored Jan 16, 2023
1 parent d93cd23 commit 9ec7f24
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions aiowebostv/webos_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ async def connect_handler(self, res):
raw_response = await main_ws.recv()
_LOGGER.debug("recv(%s): pairing", self.host)
response = json.loads(raw_response)
_LOGGER.debug(
"pairing(%s): type: %s, error: %s",
self.host,
response["type"],
response.get("error"),
)
if response["type"] == "error":
raise WebOsTvPairError(response["error"])
if response["type"] == "registered":
self.client_key = response["payload"]["client-key"]

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

PROJECT_DIR = Path(__file__).parent.resolve()
README_FILE = PROJECT_DIR / "README.md"
VERSION = "0.3.1"
VERSION = "0.3.2"


setup(
Expand Down

0 comments on commit 9ec7f24

Please sign in to comment.