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