~kennylevinsen/poweralertd

c073674538bc976fcc5faa3b5a71966f06d05844 — Kenny Levinsen 3 months ago 3ef1bf2
upower: Expand list of device types

Many deivce types were missing, in part due to them not being mentioned
by UPower documentation. They have now been expanded to all the current
29 device types.
2 files changed, 30 insertions(+), 0 deletions(-)

M upower.c
M upower.h
M upower.c => upower.c +15 -0
@@ 45,6 45,21 @@ static char *upower_type_string[UPOWER_DEVICE_TYPE_LAST] = {
	"computer",
	"gaming input",
	"pen",
	"touchpad",
	"modem",
	"network",
	"headset",
	"speakers",
	"headphones",
	"video",
	"other audio",
	"remote control",
	"printer",
	"scanner",
	"camera",
	"wearable",
	"toy",
	"bluetooth generic",
};

int upower_device_has_battery(struct upower_device *device) {

M upower.h => upower.h +15 -0
@@ 50,6 50,21 @@ enum upower_device_type {
	UPOWER_DEVICE_TYPE_COMPUTER,
	UPOWER_DEVICE_TYPE_GAMING_INPUT,
	UPOWER_DEVICE_TYPE_PEN,
	UPOWER_DEVICE_TYPE_TOUCHPAD,
	UPOWER_DEVICE_TYPE_MODEM,
	UPOWER_DEVICE_TYPE_NETWORK,
	UPOWER_DEVICE_TYPE_HEADSET,
	UPOWER_DEVICE_TYPE_SPEAKERS,
	UPOWER_DEVICE_TYPE_HEADPHONES,
	UPOWER_DEVICE_TYPE_VIDEO,
	UPOWER_DEVICE_TYPE_OTHER_AUDIO,
	UPOWER_DEVICE_TYPE_REMOTE_CONTROL,
	UPOWER_DEVICE_TYPE_PRINTER,
	UPOWER_DEVICE_TYPE_SCANNER,
	UPOWER_DEVICE_TYPE_CAMERA,
	UPOWER_DEVICE_TYPE_WEARABLE,
	UPOWER_DEVICE_TYPE_TOY,
	UPOWER_DEVICE_TYPE_BLUETOOTH_GENERIC,
	UPOWER_DEVICE_TYPE_LAST
};