From 55a2c0910e3f215fc3dd032e2900bb6d505e1e75 Mon Sep 17 00:00:00 2001 From: Richard van den Berg Date: Wed, 12 Jun 2024 08:04:01 +0200 Subject: [PATCH] Set stopAskingToStartCharging when vehicle not at home --- lib/TWCManager/Vehicle/TeslaAPI.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/TWCManager/Vehicle/TeslaAPI.py b/lib/TWCManager/Vehicle/TeslaAPI.py index e398b1ce..6664e0a6 100644 --- a/lib/TWCManager/Vehicle/TeslaAPI.py +++ b/lib/TWCManager/Vehicle/TeslaAPI.py @@ -645,12 +645,17 @@ def car_api_charge(self, charge): if not vehicle.atHome: # Vehicle is not at home, so don't change its charge state. - logger.info( + message = ( vehicle.name + " is not at home. Do not " + startOrStop + " charge." ) + # Stop asking to start charging when not at home. + if startOrStop == "start": + vehicle.stopAskingToStartCharging = True + message += " Stop asking to start charging." + logger.info(message) continue # If you send charge_start/stop less than 1 second after calling