lovr.headset.getBattery
EditReturns the battery status of a device.
level, charging = lovr.headset.getBattery(device)Arguments
| Name | Type | Default | Description |
| device | Device | 'head' | The device to check. |
Returns
| Name | Type | Description |
| level | number | The level of the battery, from 0 to 1. |
| charging | boolean | 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.