mirror of
https://github.com/Dielee/volvo2mqtt.git
synced 2026-08-08 16:59:53 +02:00
Remove done climate timers from "Active schedules" sensor
This commit is contained in:
+7
-1
@@ -138,7 +138,7 @@ def start_climate_timer(d, vin):
|
||||
return None
|
||||
|
||||
if timer_seconds > 0:
|
||||
Timer(timer_seconds, start_climate, (vin, )).start()
|
||||
Timer(timer_seconds, activate_climate_timer, (vin, start_datetime.isoformat(), )).start()
|
||||
active_schedules[vin]["timers"].append(start_datetime.isoformat())
|
||||
logging.debug("Climate timer set to " + str(start_datetime))
|
||||
update_car_data()
|
||||
@@ -184,6 +184,12 @@ def stop_climate(vin):
|
||||
update_car_data()
|
||||
|
||||
|
||||
def activate_climate_timer(vin, start_time):
|
||||
start_climate(vin)
|
||||
active_schedules[vin]["timers"].remove(start_time)
|
||||
update_car_data()
|
||||
|
||||
|
||||
def start_climate(vin):
|
||||
global assumed_climate_state, climate_timer, engine_status
|
||||
# Start the api call in another thread for HA performance
|
||||
|
||||
Reference in New Issue
Block a user