From 81d79a1b0ee6a77ae4f238f5298e167a4db63398 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Tue, 6 Jul 2021 19:30:54 -0400 Subject: [PATCH] Add formatting to charge status --- commands.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/commands.go b/commands.go index 032db60..ca3d5a6 100644 --- a/commands.go +++ b/commands.go @@ -132,19 +132,20 @@ func chargeStatus(m chat1.MsgSummary) { ret := fmt.Sprintf("Status for %+v: ```", v.DisplayName) 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("\nTime to full: %+vmin", state.MinutesToFullCharge) ret += fmt.Sprintf("\nConnected Cable: %+v", state.ConnChargeCable) - if state.FastChargerPresent { - ret += fmt.Sprintf("\nFast Charger: %+v %+v", state.FastChargerBrand, state.FastChargerType) + ret += fmt.Sprintf("\nCharging State: %+v", state.ChargingState) + if state.ChargingState != "Stopped" { + ret += fmt.Sprintf("\nTime to full: %+vmin", state.MinutesToFullCharge) + if state.FastChargerPresent { + ret += fmt.Sprintf("\nFast Charger: %+v %+v", state.FastChargerBrand, state.FastChargerType) + } } } ret += "```\n" if state.BatteryHeaterOn { ret += "The battery heater is on. " } - if state.ChargePortDoorOpen { + if state.ChargePortDoorOpen && state.ChargingState == "Disconnected" { ret += "The charge port is open. " } k.SendMessageByConvID(m.ConvID, ret)