From 0892b914085b3900653a7a8d4b45c13331a73e8e Mon Sep 17 00:00:00 2001 From: "Alan D. Tse" Date: Fri, 24 Jan 2020 00:18:37 -0800 Subject: [PATCH] fix: fix forced wake up in initial update --- teslajsonpy/controller.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/teslajsonpy/controller.py b/teslajsonpy/controller.py index 35211d2c..f2e9512d 100644 --- a/teslajsonpy/controller.py +++ b/teslajsonpy/controller.py @@ -479,7 +479,7 @@ async def update(self, car_id=None, wake_if_asleep=False, force=False): continue async with self.__lock[vin]: if ( - online + (online or wake_if_asleep) and ( # pylint: disable=too-many-boolean-expressions self.__update.get(vin) ) @@ -493,7 +493,9 @@ async def update(self, car_id=None, wake_if_asleep=False, force=False): ) ): # Only update cars with update flag on try: - data = await self.get(car_id, "data", wake_if_asleep) + data = await self.get( + car_id, "data", wake_if_asleep=wake_if_asleep + ) except TeslaException: data = None if data and data["response"]: