Only start/stop charge if plugged in to a non-Supercharger

This commit is contained in:
2021-07-06 11:25:36 -04:00
parent 1cf76471da
commit 9d185c9a03

View File

@ -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.")
}
}