Skip to content

Commit 837d65e

Browse files
committed
Bump vivintpy to 2023.3.8 and ignore auth cache in config flow
1 parent f0a5d99 commit 837d65e

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

custom_components/vivint/config_flow.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ async def async_vivint_login(
112112

113113
self._hub = VivintHub(self.hass, user_input)
114114
try:
115-
await self._hub.login(load_devices=True)
115+
await self._hub.login(load_devices=True, use_cache=False)
116116
except VivintSkyApiMfaRequiredError:
117117
return await self.async_step_mfa()
118118
except VivintSkyApiAuthenticationError:

custom_components/vivint/hub.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,21 @@ async def _async_update_data() -> None:
7474
)
7575

7676
async def login(
77-
self, load_devices: bool = False, subscribe_for_realtime_updates: bool = False
77+
self,
78+
load_devices: bool = False,
79+
subscribe_for_realtime_updates: bool = False,
80+
use_cache: bool = True,
7881
) -> bool:
7982
"""Login to Vivint."""
8083
self.logged_in = False
8184

8285
# Get previous session if available
8386
abs_cookie_jar = aiohttp.CookieJar()
84-
try:
85-
abs_cookie_jar.load(self.cache_file)
86-
except: # pylint: disable=bare-except
87-
_LOGGER.debug("No previous session found")
87+
if use_cache:
88+
try:
89+
abs_cookie_jar.load(self.cache_file)
90+
except: # pylint: disable=bare-except
91+
_LOGGER.debug("No previous session found")
8892

8993
self.session = ClientSession(cookie_jar=abs_cookie_jar)
9094

custom_components/vivint/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"iot_class": "cloud_push",
1010
"issue_tracker": "https://github.com/natekspencer/hacs-vivint/issues",
1111
"loggers": ["custom_components.vivint", "vivintpy"],
12-
"requirements": ["vivintpy==2023.3.7"],
12+
"requirements": ["vivintpy==2023.3.8"],
1313
"version": "0.0.0",
1414
"zeroconf": ["_vivint-ODC300._tcp.local.", "_vivint-DBC350._tcp.local."]
1515
}

0 commit comments

Comments
 (0)