Browse Source

Add some cleanup to charge status, and then lowercase trunk

master
Gregory Rudolph 4 years ago
parent
commit
d2e3b91457
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 15
      commands.go

15
commands.go

@ -113,11 +113,14 @@ func chargeStatus(m chat1.MsgSummary) {
} }
ret := fmt.Sprintf("Status for %+v: ```", v.DisplayName) ret := fmt.Sprintf("Status for %+v: ```", v.DisplayName)
ret += fmt.Sprintf("\nCurrent Charge: %+v (%+vmi)", state.BatteryLevel, state.BatteryRange) ret += fmt.Sprintf("\nCurrent Charge: %+v (%+vmi)", state.BatteryLevel, state.BatteryRange)
ret += fmt.Sprintf("\nCharging State: %+v", state.ChargingState) if state.ChargingState != "Disconnected" {
ret += fmt.Sprintf("\nTime to full: %+vmin", state.MinutesToFullCharge)
ret += fmt.Sprintf("\nConnected Cable: %+v", state.ConnChargeCable) ret += fmt.Sprintf("\nCharging State: %+v", state.ChargingState)
if state.FastChargerPresent { ret += fmt.Sprintf("\nTime to full: %+vmin", state.MinutesToFullCharge)
ret += fmt.Sprintf("\nFast Charger: %+v %+v", state.FastChargerBrand, state.FastChargerType) ret += fmt.Sprintf("\nConnected Cable: %+v", state.ConnChargeCable)
if state.FastChargerPresent {
ret += fmt.Sprintf("\nFast Charger: %+v %+v", state.FastChargerBrand, state.FastChargerType)
}
} }
ret += "```\n" ret += "```\n"
if state.BatteryHeaterOn { if state.BatteryHeaterOn {
@ -346,7 +349,7 @@ func openTrunk(m chat1.MsgSummary) {
switch trunk { switch trunk {
case "rear": case "rear":
case "front": case "front":
err := v.OpenTrunk(trunk) err := v.OpenTrunk(strings.ToLower(trunk))
if err != nil { if err != nil {
tracker := uuid.NewString() tracker := uuid.NewString()
k.SendMessageByConvID(m.ConvID, "There was an error opening your trunk. Contact @rudi9719 for more information with code %+v", tracker) k.SendMessageByConvID(m.ConvID, "There was an error opening your trunk. Contact @rudi9719 for more information with code %+v", tracker)

Loading…
Cancel
Save