def _extract_battery_info_from_acpi(self):
        """
        Get the battery info from acpi

        # Example acpi -bi raw output (Discharging):
        Battery 0: Discharging, 94%, 09:23:28 remaining
        Battery 0: design capacity 5703 mAh, last full capacity 5283 mAh = 92%
        Battery 1: Unknown, 98%
        Battery 1: design capacity 1880 mAh, last full capacity 1370 mAh = 72%

        # Example Charging
        Battery 0: Charging, 96%, 00:20:40 until charged
        Battery 0: design capacity 5566 mAh, last full capacity 5156 mAh = 92%
        Battery 1: Unknown, 98%
        Battery 1: design capacity 1879 mAh, last full capacity 1370 mAh = 72%
        """

        def _parse_battery_info(acpi_battery_lines):
            battery = {}
            battery["percent_charged"] = int(findall(r"(?<= )(\d+)(?=%)", acpi_battery_lines[0])[0])
            battery["charging"] = "Charging" in acpi_battery_lines[0]
            battery["capacity"] = int(findall(r"(?<= )(\d+)(?= mAh)", acpi_battery_lines[1])[1])

            # ACPI only shows time remaining if battery is discharging or
            # charging
            try:
                battery["time_remaining"] = "".join(
                    findall(
                        r"(?<=, )(\d+:\d+:\d+)(?= remaining)|" r"(?<=, )(\d+:\d+:\d+)(?= until)",
                        acpi_battery_lines[0],
                    )[0]
                )
            except IndexError:
                battery["time_remaining"] = FULLY_CHARGED

            # TODO: Not implemented yet
            battery["power"] = 0.0

            return battery

        acpi_list = self.py3.command_output(["acpi", "-b", "-i"]).splitlines()

        # Separate the output because each pair of lines corresponds to a
        # single battery.  Now the list index will correspond to the index of
        # the battery we want to look at
        temporary = {}
        for line in acpi_list:
            number = line.split(":", 1)[0].strip("Battery ")
            temporary.setdefault(number, []).append(line)

        new_acpi = {}
        for k, v in temporary.items():
            if "rate information unavailable" not in "|".join(v):
                new_acpi[k] = v

        return [_parse_battery_info(battery) for battery in new_acpi.values()]

        Get the battery info from acpi

        # Example acpi -bi raw output (Discharging):
        Battery 0: Discharging, 94%, 09:23:28 remaining
        Battery 0: design capacity 5703 mAh, last full capacity 5283 mAh = 92%
        Battery 1: Unknown, 98%
        Battery 1: design capacity 1880 mAh, last full capacity 1370 mAh = 72%

        # Example Charging
        Battery 0: Charging, 96%, 00:20:40 until charged
        Battery 0: design capacity 5566 mAh, last full capacity 5156 mAh = 92%
        Battery 1: Unknown, 98%
        Battery 1: design capacity 1879 mAh, last full capacity 1370 mAh = 72%
        
py3status/modules/battery_level.py