[gnome-control-center/wip/hadess/fix-power-scenario-test: 9/9] power: Add scenario for a 2nd non-charging laptop battery




commit fa01d3f10a056ba0812327ef5e3f61f3d9ee99ff
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jan 26 13:15:28 2022 +0100

    power: Add scenario for a 2nd non-charging laptop battery

 panels/power/power-panel-scenario-tester.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
---
diff --git a/panels/power/power-panel-scenario-tester.py b/panels/power/power-panel-scenario-tester.py
index 6c8a0f18d..3738409e7 100755
--- a/panels/power/power-panel-scenario-tester.py
+++ b/panels/power/power-panel-scenario-tester.py
@@ -163,6 +163,20 @@ class GccDBusTestCase(DBusTestCase):
                      'cycle_count', '250'], [])
             return [ dev ]
 
+        elif device == '2nd-battery':
+            # Not charging or discharging
+            # No cycle count available
+            dev = self.testbed.add_device('power_supply', 'BAT1', None,
+                    ['type', 'Battery',
+                     'present', '1',
+                     'status', 'Not charging',
+                     'energy_full', '30000000',
+                     'energy_full_design', '40000000',
+                     'energy_now', '20000000',
+                     'voltage_now', '12000000',
+                     'cycle_count', '-1'], [])
+            return [ dev ]
+
         elif device == 'ac':
             dev = self.testbed.add_device('power_supply', 'AC', None,
                     ['type', 'Mains', 'online', '0'], [])
@@ -263,6 +277,9 @@ class GccDBusTestCase(DBusTestCase):
         function_item = FunctionItem("Toggle laptop battery", self.toggle_devices, [['ac', 'battery']])
         menu.append_item(function_item)
 
+        function_item = FunctionItem("Toggle 2nd battery", self.toggle_devices, [['2nd-battery']])
+        menu.append_item(function_item)
+
         function_item = FunctionItem("Cycle degraded performance", self.cycle_degraded, [])
         menu.append_item(function_item)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]