blob: b98c120e8a7cf3246a8a8d92f34bf7bf96796ef3 [file] [log] [blame]
Shawn McCarney54ed0a12021-12-08 11:14:46 -06001description: >
2 "org.freedesktop.UPower.Device -- Device interface
3 Defined at https://upower.freedesktop.org/docs/Device.html
4 Objects implementing org.freedesktop.UPower.Device also implement the
5 org.freedesktop.DBus.Introspectable and org.freedesktop.DBus.Properties
6 interfaces. Unless otherwise noted, an empty string or the value 0 in a
7 property on this interface means not set."
8
9methods:
10 - name: Refresh
11 description: >
12 "Refreshes the data collected from the power source. Callers need the
13 org.freedesktop.upower.refresh-power-source authorization"
14
15 - name: GetHistory
16 description: >
17 "Gets history for the power device that is persistent across
18 reboots."
19 parameters:
Patrick Williams8da396c2022-03-14 14:21:02 -050020 - name: type
21 type: string
22 description: >
23 "The type of history. Valid types are rate or charge."
24 - name: timespan
25 type: uint32
26 description: >
27 "The amount of data to return in seconds, or 0 for all."
28 - name: resolution
29 type: uint32
30 description: >
Patrick Williamsa1347412022-12-06 10:56:22 -060031 "The approximate number of points to return. A higher resolution
32 is
Patrick Williams8da396c2022-03-14 14:21:02 -050033 more accurate, at the expense of plotting speed."
Shawn McCarney54ed0a12021-12-08 11:14:46 -060034 returns:
Patrick Williams8da396c2022-03-14 14:21:02 -050035 - name: data
36 type: array[struct[uint32, double, uint32]]
37 description: >
38 "The history data for the power device, if the device supports
Patrick Williamsa1347412022-12-06 10:56:22 -060039 history. Data is ordered from the earliest in time, to the
40 newest
Patrick Williams8da396c2022-03-14 14:21:02 -050041 data point. Each element contains the following members:
Patrick Williamsa1347412022-12-06 10:56:22 -060042 time: The time value in seconds from the gettimeofday()
43 method.
44 value: The data value, for instance the rate in W or the
45 charge
Patrick Williams8da396c2022-03-14 14:21:02 -050046 in %.
47 state: The state of the device, for instance charging or
48 discharging."
Shawn McCarney54ed0a12021-12-08 11:14:46 -060049
50 - name: GetStatistics
51 description: >
52 "Gets statistics for the power device that may be interesting to show
53 on a graph in the session."
54 parameters:
Patrick Williams8da396c2022-03-14 14:21:02 -050055 - name: type
56 type: string
57 description: >
58 "The mode for the statistics. Valid types are charging or
59 discharging."
Shawn McCarney54ed0a12021-12-08 11:14:46 -060060 returns:
Patrick Williams8da396c2022-03-14 14:21:02 -050061 - name: data
62 type: array[struct[double, double]]
63 description: >
Patrick Williamsa1347412022-12-06 10:56:22 -060064 "The statistics data for the power device. Each element contains
65 the
Patrick Williams8da396c2022-03-14 14:21:02 -050066 following members:
67 value: The value of the percentage point, usually in seconds.
68 accuracy: The accuracy of the prediction in percent."
Shawn McCarney54ed0a12021-12-08 11:14:46 -060069
70properties:
71 - name: NativePath
72 default: ""
73 type: string
74 description: >
75 "OS specific native path of the power source. On Linux this is the
76 sysfs path, for example
77 /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0. Is
78 blank if the device is being driven by a user space driver."
79 - name: Vendor
80 default: ""
81 type: string
82 description: >
83 "Name of the vendor of the battery."
84 - name: Model
85 default: ""
86 type: string
87 description: >
88 "Name of the model of this battery."
89 - name: Serial
90 default: ""
91 type: string
92 description: >
93 "Unique serial number of the battery."
94 - name: UpdateTime
95 default: 0
96 type: uint64
97 description: >
98 "The point in time (seconds since the Epoch Jan 1, 1970 0:00 UTC)
99 that data was read from the power source."
100 - name: Type
101 default: 0
102 type: uint32
103 description: >
104 "Type of power source.
105 0: Unknown
106 1: Line Power
107 2: Battery
108 3: Ups
109 4: Monitor
110 5: Mouse
111 6: Keyboard
112 7: Pda
113 8: Phone"
114 - name: PowerSupply
115 default: false
116 type: boolean
117 description: >
118 "If the power device is used to supply the system. This would be set
119 TRUE for laptop batteries and UPS devices, but set FALSE for wireless
120 mice or PDAs."
121 - name: HasHistory
122 default: false
123 type: boolean
124 description: >
125 "If the power device has history."
126 - name: HasStatistics
127 default: false
128 type: boolean
129 description: >
130 "If the power device has statistics."
131 - name: Online
132 default: false
133 type: boolean
134 description: >
135 "Whether power is currently being provided through line power. This
136 property is only valid if the property type has the value
137 'line-power'."
138 - name: Energy
139 default: 0.0
140 type: double
141 description: >
142 "Amount of energy (measured in Wh) currently available in the power
143 source. This property is only valid if the property type has the
144 value 'battery'."
145 - name: EnergyEmpty
146 default: 0.0
147 type: double
148 description: >
149 "Amount of energy (measured in Wh) in the power source when it's
150 considered to be empty. This property is only valid if the property
151 type has the value 'battery'."
152 - name: EnergyFull
153 default: 0.0
154 type: double
155 description: >
156 "Amount of energy (measured in Wh) in the power source when it's
157 considered full. This property is only valid if the property type
158 has the value 'battery'."
159 - name: EnergyFullDesign
160 default: 0.0
161 type: double
162 description: >
163 "Amount of energy (measured in Wh) the power source is designed to
164 hold when it's considered full. This property is only valid if the
165 property type has the value 'battery'."
166 - name: EnergyRate
167 default: 0.0
168 type: double
169 description: >
170 "Amount of energy being drained from the source, measured in W. If
171 positive, the source is being discharged, if negative it's being
172 charged. This property is only valid if the property type has the
173 value 'battery'."
174 - name: Voltage
175 default: 0.0
176 type: double
177 description: >
178 "Voltage in the Cell or being recorded by the meter."
179 - name: Luminosity
180 default: 0.0
181 type: double
182 description: >
183 "Luminosity being recorded by the meter."
184 - name: TimeToEmpty
185 default: 0
186 type: int64
187 description: >
188 "Number of seconds until the power source is considered empty. Is set
189 to 0 if unknown. This property is only valid if the property type
190 has the value 'battery'."
191 - name: TimeToFull
192 default: 0
193 type: int64
194 description: >
195 "Number of seconds until the power source is considered full. Is set
196 to 0 if unknown. This property is only valid if the property type
197 has the value 'battery'."
198 - name: Percentage
199 default: 0.0
200 type: double
201 description: >
202 "The amount of energy left in the power source expressed as a
203 percentage between 0 and 100. Typically this is the same as (energy -
204 energy-empty) / (energy-full - energy-empty). However, some primitive
205 power sources are capable of only reporting percentages and in this
206 case the energy-* properties will be unset while this property is
207 set. This property is only valid if the property type has the value
208 'battery'."
209 - name: Temperature
210 default: 0.0
211 type: double
212 description: >
213 "The temperature of the device in degrees Celsius. This property is
214 only valid if the property type has the value 'battery'."
215 - name: IsPresent
216 default: false
217 type: boolean
218 description: >
219 "If the power source is present in the bay. This field is required as
220 some batteries are hot-removable, for example expensive UPS and most
221 laptop batteries. This property is only valid if the property type
222 has the value 'battery'."
223 - name: State
224 default: 0
225 type: uint32
226 description: >
227 "The battery power state.
228 0: Unknown
229 1: Charging
230 2: Discharging
231 3: Empty
232 4: Fully charged
233 5: Pending charge
234 6: Pending discharge
235 This property is only valid if the property type has the value
236 'battery'."
237 - name: IsRechargeable
238 default: false
239 type: boolean
240 description: >
241 "If the power source is rechargeable. This property is only valid if
242 the property type has the value 'battery'."
243 - name: Capacity
244 default: 0.0
245 type: double
246 description: >
247 "The capacity of the power source expressed as a percentage between 0
248 and 100. The capacity of the battery will reduce with age. A capacity
249 value less than 75% is usually a sign that you should renew your
250 battery. Typically this value is the same as (full-design / full) *
251 100. However, some primitive power sources are not capable reporting
252 capacity and in this case the capacity property will be unset. This
253 property is only valid if the property type has the value 'battery'."
254 - name: Technology
255 default: 0
256 type: uint32
257 description: >
258 "Technology used in the battery:
259 0: Unknown
260 1: Lithium ion
261 2: Lithium polymer
262 3: Lithium iron phosphate
263 4: Lead acid
264 5: Nickel cadmium
265 6: Nickel metal hydride
266 This property is only valid if the property type has the value
267 'battery'."
268 - name: WarningLevel
269 default: 0
270 type: uint32
271 description: >
272 "Warning level of the battery:
273 0: Unknown
274 1: None
275 2: Discharging (only for UPSes)
276 3: Low
277 4: Critical
278 5: Action"
279 - name: BatteryLevel
280 default: 0
281 type: uint32
282 description: >
283 "Level of the battery:
284 0: Unknown
Patrick Williamsa1347412022-12-06 10:56:22 -0600285 1: None (the battery does not use a coarse level of battery
286 reporting)
Shawn McCarney54ed0a12021-12-08 11:14:46 -0600287 3: Low
288 4: Critical
289 6: Normal
290 7: High
291 8: Full"
292 - name: IconName
293 default: ""
294 type: string
295 description: >
296 "An icon name, following the Icon Naming Specification"