func (i Info) SignedPower() float64 {
	if i.Discharging() {
		return -i.Power
	}
	return i.Power
}
SignedPower returns a positive power value when the battery
is being charged, and a negative power value when discharged.
package battery  
import (
	"bufio"
	"bytes"
	"fmt"
	"math"
	"strconv"
	"strings"
	"time"
	"barista.run/bar"
	"barista.run/base/value"
	l "barista.run/logging"
	"barista.run/outputs"
	"barista.run/timing"
	"github.com/spf13/afero"
)
type Status string
const (
	Disconnected Status = "Disconnected"
	Charging Status = "Charging"
	Discharging Status = "Discharging"
	Full Status = "Full"
	NotCharging Status = "Not charging"
	Unknown Status = ""
)
type Info struct {
	Capacity int
	EnergyFull float64
	EnergyMax float64
	EnergyNow float64
	Power float64
	Voltage float64
	Status Status
	Technology string
}
func (i Info) Remaining() float64 {
	if math.Nextafter(i.EnergyFull, 0) == 0 {
		return 0
	}
	return i.EnergyNow / i.EnergyFull
}
func (i Info) RemainingPct() int {
	return int(i.Remaining() * 100)
}
func (i Info) RemainingTime() time.Duration {
	if math.Nextafter(i.Power, 0) == 0 {
		return 0
	}
	hours := 0.0
	switch i.Status {
	case Charging:
		hours = (i.EnergyFull - i.EnergyNow) / i.Power
	case Discharging:
		hours = i.EnergyNow / i.Power
	}
	return time.Duration(int(hours*3600)) * time.Second
}
func (i Info) Discharging() bool {
	return i.Status == Discharging
}
func (i Info) PluggedIn() bool {
	return i.Status == Charging || i.Status == Full || i.Status == NotCharging
}