joshuar-go-hass-agent/internal/linux/battery/batteryLevelsStrings.go

46 lines
1.2 KiB
Go

// Code generated by "stringer -type=batteryLevel -output batteryLevelsStrings.go -linecomment"; DO NOT EDIT.
package battery
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[batteryLevelUnknown-0]
_ = x[batteryLevelNone-1]
_ = x[batteryLevelLow-3]
_ = x[batteryLevelCrit-4]
_ = x[batteryLevelNorm-6]
_ = x[batteryLevelHigh-7]
_ = x[batteryLevelFull-8]
}
const (
_batteryLevel_name_0 = "UnknownNone"
_batteryLevel_name_1 = "LowCritical"
_batteryLevel_name_2 = "NormalHighFull"
)
var (
_batteryLevel_index_0 = [...]uint8{0, 7, 11}
_batteryLevel_index_1 = [...]uint8{0, 3, 11}
_batteryLevel_index_2 = [...]uint8{0, 6, 10, 14}
)
func (i batteryLevel) String() string {
switch {
case i <= 1:
return _batteryLevel_name_0[_batteryLevel_index_0[i]:_batteryLevel_index_0[i+1]]
case 3 <= i && i <= 4:
i -= 3
return _batteryLevel_name_1[_batteryLevel_index_1[i]:_batteryLevel_index_1[i+1]]
case 6 <= i && i <= 8:
i -= 6
return _batteryLevel_name_2[_batteryLevel_index_2[i]:_batteryLevel_index_2[i+1]]
default:
return "batteryLevel(" + strconv.FormatInt(int64(i), 10) + ")"
}
}