def _extract_battery_info_from_sys(self):
        """
        Extract the percent charged, charging state, time remaining,
        and capacity for a battery, using Linux's kernel /sys interface

        Only available in kernel 2.6.24(?) and newer. Before kernel provided
        a similar, yet incompatible interface in /proc
        """

        if not any(Path(self.sys_battery_path).iterdir()):
            return []

        def _parse_battery_info(sys_path):
            """
            Extract battery information from uevent file, already convert to
            int if necessary
            """
            raw_values = {}
            with (sys_path / "uevent").open() as f:
                for var in f.read().splitlines():
                    k, v = var.split("=")
                    try:
                        raw_values[k] = int(v)
                    except ValueError:
                        raw_values[k] = v
            return raw_values

        battery_list = []

        bglobs = ["BAT*", "*bat*"]
        path_its = itertools.chain(*[Path(self.sys_battery_path).glob(bglob) for bglob in bglobs])

        for path in path_its:
            r = _parse_battery_info(path)

            if not r:
                continue

            capacity = r.get("POWER_SUPPLY_ENERGY_FULL", r.get("POWER_SUPPLY_CHARGE_FULL"))
            present_rate = r.get(
                "POWER_SUPPLY_POWER_NOW",
                r.get("POWER_SUPPLY_CURRENT_NOW", r.get("POWER_SUPPLY_VOLTAGE_NOW")),
            )
            remaining_energy = r.get("POWER_SUPPLY_ENERGY_NOW", r.get("POWER_SUPPLY_CHARGE_NOW"))
            current_now = r.get("POWER_SUPPLY_CURRENT_NOW", r.get("POWER_SUPPLY_POWER_NOW", 0))
            voltage_now = r.get("POWER_SUPPLY_VOLTAGE_NOW", 0)

            # missing values may indicate this is not a battery and should be skipped
            if (
                capacity is None
                or present_rate is None
                or remaining_energy is None
                or current_now is None
                or voltage_now is None
            ):
                continue

            battery = {}
            battery["capacity"] = capacity
            battery["charging"] = "Charging" in r["POWER_SUPPLY_STATUS"]
            battery["percent_charged"] = math.floor(remaining_energy / capacity * 100)
            if present_rate == 0:
                # Battery is either full charged or is not discharging
                battery["time_remaining"] = FULLY_CHARGED
            else:
                if battery["charging"]:
                    time_in_secs = (capacity - remaining_energy) / present_rate * 3600
                else:
                    time_in_secs = remaining_energy / present_rate * 3600
                battery["time_remaining"] = self._seconds_to_hms(time_in_secs)

            battery["power"] = current_now * voltage_now / 10**12

            battery_list.append(battery)
        return battery_list

        Extract the percent charged, charging state, time remaining,
        and capacity for a battery, using Linux's kernel /sys interface

        Only available in kernel 2.6.24(?) and newer. Before kernel provided
        a similar, yet incompatible interface in /proc
        
py3status/modules/battery_level.py