battery

package
v0.0.0-...-7f005ae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetermineHardwareStatus

func DetermineHardwareStatus(ctx context.Context, fullChargeCapacity float64, fullChargeCapacityDesigned float64) tlw.HardwareState

DetermineHardwareStatus determines the battery hardwareState based on the charging capacity of the DUT's battery.

The logic for determining hardware state based on:

if capacity >= 70% then NORMAL
if capacity >= 40% then ACCEPTABLE
if capacity  < 40% then NEED_REPLACEMENT

func ReadBatteryInfo

func ReadBatteryInfo(ctx context.Context, r execs.Runner) (*batteryInfo, error)

ReadBatteryInfo reads battery related information from the powerSupplyInfo struct in the power package and assign value to each of the field for the batteryInfo struct. returns an error when it cannot read related battery information.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL