Skip to content

Commit 68db6c7

Browse files
committed
Support auth only for login
1 parent 20f48c2 commit 68db6c7

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

pymyq/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""Define a version constant."""
2-
__version__ = "3.1.0"
2+
__version__ = "3.1.1"

pymyq/api.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,12 @@ async def update_device_info(self) -> None:
578578
self.last_state_update = datetime.utcnow()
579579

580580

581-
async def login(username: str, password: str, websession: ClientSession = None) -> API:
581+
async def login(
582+
username: str,
583+
password: str,
584+
websession: ClientSession = None,
585+
auth_only: bool = False,
586+
) -> API:
582587
"""Log in to the API."""
583588

584589
# Set the user agent in the headers.
@@ -593,8 +598,9 @@ async def login(username: str, password: str, websession: ClientSession = None)
593598
_LOGGER.error("Authentication failed: %s", str(err))
594599
raise err
595600

596-
# Retrieve and store initial set of devices:
597-
_LOGGER.debug("Retrieving MyQ information")
598-
await api.update_device_info()
601+
if not auth_only:
602+
# Retrieve and store initial set of devices:
603+
_LOGGER.debug("Retrieving MyQ information")
604+
await api.update_device_info()
599605

600606
return api

0 commit comments

Comments
 (0)