From 9d185c9a0342a46c7785b4b5c942b39e83255ff1 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Tue, 6 Jul 2021 11:25:36 -0400 Subject: [PATCH] Only start/stop charge if plugged in to a non-Supercharger --- commands.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/commands.go b/commands.go index 12b4f4c..70b69b7 100644 --- a/commands.go +++ b/commands.go @@ -313,7 +313,7 @@ func startCharge(m chat1.MsgSummary) { log.LogError("%+v: %+v", tracker, err) return } - if state.ChargingState != "Disconnected" { + if state.ChargingState != "Disconnected" && state.FastChargerBrand != "Tesla" { err := v.StartCharging() if err != nil { tracker := uuid.NewString() @@ -322,7 +322,7 @@ func startCharge(m chat1.MsgSummary) { return } } else { - k.SendMessageByConvID(m.ConvID, "You must plug in first, to be able to charge.") + k.SendMessageByConvID(m.ConvID, "You must plug in to an L1/L2 charger to use this command.") } } @@ -339,7 +339,7 @@ func stopCharge(m chat1.MsgSummary) { log.LogError("%+v: %+v", tracker, err) return } - if state.ChargingState != "Disconnected" { + if state.ChargingState != "Disconnected" && state.FastChargerBrand != "Tesla" { err := v.StopCharging() if err != nil { tracker := uuid.NewString() @@ -348,7 +348,7 @@ func stopCharge(m chat1.MsgSummary) { return } } else { - k.SendMessageByConvID(m.ConvID, "You must plug in first, to be able to stop charging.") + k.SendMessageByConvID(m.ConvID, "You must plug in to an L1/L2 charger to use this command.") } }