Run of fresh-snapshots for battery-stats

Try this locally (using silver-platter):

debian-svp new-upstream --snapshot battery-stats 

Merge these changes:

git pull https://janitor.debian.net/git/battery-stats fresh-snapshots/main

Summary

Merged new upstream version: 0.5.6+git20181021.b231366 (was: 0.5.6).

Diff

diff --git a/debian/changelog b/debian/changelog
index 918616b..f61d38e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,12 +1,16 @@
-battery-stats (0.5.6-2) UNRELEASED; urgency=medium
+battery-stats (0.5.6+git20181021.b231366-1) UNRELEASED; urgency=medium
 
+  [ Ondřej Nový ]
   * d/control: Remove ancient X-Python-Version field
   * d/control: Deprecating priority extra as per policy 4.0.1
   * d/changelog: Remove trailing whitespaces
   * d/control: Remove trailing whitespaces
   * d/control: Set Vcs-* to salsa.debian.org
 
- -- Ondřej Nový <onovy@debian.org>  Mon, 01 Oct 2018 09:56:14 +0200
+  [ Debian Janitor ]
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Tue, 26 Nov 2019 17:30:39 +0000
 
 battery-stats (0.5.6-1) unstable; urgency=medium
 
diff --git a/src/battery-stats-collector b/src/battery-stats-collector
index 8e3cff7..51f7509 100755
--- a/src/battery-stats-collector
+++ b/src/battery-stats-collector
@@ -24,15 +24,21 @@ get_logline() {
 
     if [ -f /sys/class/power_supply/AC/online ]; then
         aconline=$(cat /sys/class/power_supply/AC/online)
+    elif [ -f /sys/class/power_supply/AC0/online ]; then
+        aconline=$(cat /sys/class/power_supply/AC0/online)
     elif [ -f /sys/class/power_supply/ACAD/online ]; then
         aconline=$(cat /sys/class/power_supply/ACAD/online)
+    elif [ -f /sys/class/power_supply/ADP0/online ]; then
+        aconline=$(cat /sys/class/power_supply/ADP0/online)
     elif [ -f /sys/class/power_supply/ADP1/online ]; then
         aconline=$(cat /sys/class/power_supply/ADP1/online)
     else
-        echo "No power supply found"
+        aconline="none"
     fi
 
-    if [ 1 = "$aconline" ]; then
+    if [ "$aconline" = "none" ]; then
+        state=0
+    elif [ 1 = "$aconline" ]; then
         state=2
     else
         state=1
diff --git a/src/battery-stats-graph b/src/battery-stats-graph
index 2e651e4..84ad5a9 100755
--- a/src/battery-stats-graph
+++ b/src/battery-stats-graph
@@ -50,6 +50,21 @@ now = 'energy_now'
 full = 'energy_full'
 full_design = 'energy_full_design'
 
+# keep a copy of the original iterator function
+real_readline = logfiles.next
+
+def sanitized_readline():
+    """clear out null characters from input
+
+Those show up in the CSV logfiles frequently as updates happen during
+shutdown or power outages.
+    """
+    line = real_readline()
+    return line.replace("\0", "")
+
+# replace the iterator with our filtered version
+logfiles.next = sanitized_readline
+
 def parse_csv_np():
     logging.debug('loading CSV file %s with NumPy', args.logfile)
     data = np.genfromtxt(logfiles,

Full worker log Full build log