From 30449acecc58eaa8a7f59f6e4bdf90dc21568419 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Mon, 7 Apr 2025 12:21:24 +0800 Subject: [PATCH] linux: integration-test: determining a low power charger based on battery percenatge change If the line power is attached and the battery percentage drops 3% within 300 seconds, upower determines the attached line power is a low-power charger. --- src/linux/integration-test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/linux/integration-test.py b/src/linux/integration-test.py index a507f36..de16622 100755 --- a/src/linux/integration-test.py +++ b/src/linux/integration-test.py @@ -676,9 +676,12 @@ class Tests(dbusmock.DBusTestCase): # a low power charger causes the battery is discharging and the AC is online self.testbed.set_attribute(ac, "online", "1") + self.testbed.set_attribute(bat0, "energy_now", "3600000") self.testbed.set_attribute(bat0, "status", "Discharging") - self.testbed.set_attribute(bat0, "energy_now", "1500000") self.start_daemon() + time.sleep(5) + self.testbed.set_attribute(bat0, "energy_now", "1500000") + time.sleep(30) devs = self.proxy.EnumerateDevices() self.assertEqual(len(devs), 2) self.assertEqual(self.get_dbus_property("OnBattery"), True)