sensor: ac adapter

This commit is contained in:
Alastair Poole 2021-06-08 09:12:18 +01:00
parent 644cbfcf7a
commit d9d7d3550e
1 changed files with 9 additions and 0 deletions

View File

@ -534,6 +534,15 @@ system_power_state_get(power_t *power)
power->have_ac = atoi(buf);
free(buf);
}
else
{
char *buf = file_contents("/sys/class/power_supply/ACAD/online");
if (buf)
{
power->have_ac = atoi(buf);
free(buf);
}
}
#endif
_battery_state_get(power);