Skip to content

Commit 247cc6c

Browse files
authored
Merge pull request #46 from plugwise/passwdfix
Check codefactor
2 parents cba264f + bf3e565 commit 247cc6c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

plugwise/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Plugwise module."""
22

3-
__version__ = "0.8.2"
3+
__version__ = "0.8.3"
44

55
from plugwise.smile import Smile
66
from plugwise.stick import stick

plugwise/smile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class Smile:
6666
def __init__(
6767
self,
6868
host,
69-
smile_id,
69+
password,
7070
username=DEFAULT_USERNAME,
7171
port=DEFAULT_PORT,
7272
timeout=DEFAULT_TIMEOUT,
@@ -86,7 +86,7 @@ async def _create_session() -> aiohttp.ClientSession:
8686
else:
8787
self.websession = websession
8888

89-
self._auth = aiohttp.BasicAuth(username, password=smile_id)
89+
self._auth = aiohttp.BasicAuth(username, password=password)
9090
# Work-around for Stretchv2-aiohttp-deflate-error, can be removed for aiohttp v3.7
9191
self._headers = {"Accept-Encoding": "gzip"}
9292

tests/test_smile.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
import os
88
from pprint import PrettyPrinter
99

10+
# String generation
11+
import random
12+
import string
13+
1014
# Testing
1115
import aiohttp
1216
import jsonpickle as json
@@ -203,7 +207,7 @@ async def connect(self, broken=False, timeout=False, put_timeout=False):
203207
smile = Smile(
204208
host=server.host,
205209
username="smile",
206-
smile_id="abcdefgh",
210+
password="".join(random.choice(string.ascii_lowercase) for i in range(8)),
207211
port=server.port,
208212
websession=websession,
209213
)

0 commit comments

Comments
 (0)