Add some cleanup to charge status, and then lowercase trunk

This commit is contained in:
2021-07-04 11:17:43 -04:00
parent 122e0564cc
commit d2e3b91457

View File

@ -113,12 +113,15 @@ 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)
if state.ChargingState != "Disconnected" {
ret += fmt.Sprintf("\nCharging State: %+v", state.ChargingState) ret += fmt.Sprintf("\nCharging State: %+v", state.ChargingState)
ret += fmt.Sprintf("\nTime to full: %+vmin", state.MinutesToFullCharge) ret += fmt.Sprintf("\nTime to full: %+vmin", state.MinutesToFullCharge)
ret += fmt.Sprintf("\nConnected Cable: %+v", state.ConnChargeCable) ret += fmt.Sprintf("\nConnected Cable: %+v", state.ConnChargeCable)
if state.FastChargerPresent { if state.FastChargerPresent {
ret += fmt.Sprintf("\nFast Charger: %+v %+v", state.FastChargerBrand, state.FastChargerType) ret += fmt.Sprintf("\nFast Charger: %+v %+v", state.FastChargerBrand, state.FastChargerType)
} }
}
ret += "```\n" ret += "```\n"
if state.BatteryHeaterOn { if state.BatteryHeaterOn {
ret += "The battery heater is on. " ret += "The battery heater is on. "
@ -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)