trickle-charge: Don't change charge type on system chargers

We're supposed to only change the charge type of devices attached to us.

Closes: #85
This commit is contained in:
Bastien Nocera 2022-02-12 23:01:52 +01:00
parent 92cf0278b0
commit f48f6ca28d

View file

@ -56,6 +56,9 @@ set_charge_type (PpdActionTrickleCharge *action,
GUdevDevice *dev = l->data;
const char *value;
if (g_strcmp0 (g_udev_device_get_sysfs_attr (dev, "scope"), "Device") != 0)
continue;
value = g_udev_device_get_sysfs_attr_uncached (dev, CHARGE_TYPE_SYSFS_NAME);
if (!value)
continue;