File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
custom_components/tesla_custom Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 3131
3232
3333CHARGING_STATE_CHARGING = "Charging"
34+ CHARGING_STATE_STOPPED = "Stopped"
3435
3536
3637def is_car_state_charging (car_state : str ) -> bool :
@@ -95,7 +96,9 @@ def cast_plugged_in(val: str, car: TeslaCar) -> str:
9596
9697 if plugged_in :
9798 return (
98- CHARGING_STATE_CHARGING if is_car_state_charging (car .state ) else "Stopped"
99+ CHARGING_STATE_CHARGING
100+ if is_car_state_charging (car .state )
101+ else CHARGING_STATE_STOPPED
99102 )
100103
101104 return "Disconnected"
@@ -366,6 +369,8 @@ async def async_handle_new_data(self, msg: ReceiveMessage):
366369
367370 if is_car_state_charging (state ):
368371 self .update_charging_state (car , CHARGING_STATE_CHARGING )
372+ else :
373+ self .update_charging_state (car , CHARGING_STATE_STOPPED )
369374
370375 self .update_car_state (car , None , "state" , state )
371376
You can’t perform that action at this time.
0 commit comments