Browse Source

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

master
Gregory Rudolph 3 years ago
parent
commit
9d185c9a03
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 8
      commands.go

8
commands.go

@ -313,7 +313,7 @@ func startCharge(m chat1.MsgSummary) { @@ -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) { @@ -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) { @@ -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) { @@ -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.")
}
}

Loading…
Cancel
Save