lovr.headset.getBattery

Edit

Returns the battery status of a device.

level, charging = lovr.headset.getBattery(device)

Arguments

NameTypeDefaultDescription
deviceDevice'head' The device to check.

Returns

NameTypeDescription
levelnumber The level of the battery, from 0 to 1.
chargingboolean Whether the battery is currently charging.

Notes

This function will return nil if the device doesn't have a battery, or if the battery feature in lovr.headset.getFeatures is not supported.

This function is not currently able to measure the battery of the headset, only controllers and other devices.

The battery info is intended to only be used for display purposes, not to drive logic.

See also