xref: /openbmc/phosphor-dbus-interfaces/yaml/org/freedesktop/UPower/Device.interface.yaml (revision a1347418307d31a94bd21f22897aa508df938dcf)
154ed0a11SShawn McCarneydescription: >
254ed0a11SShawn McCarney    "org.freedesktop.UPower.Device -- Device interface
354ed0a11SShawn McCarney     Defined at https://upower.freedesktop.org/docs/Device.html
454ed0a11SShawn McCarney     Objects implementing org.freedesktop.UPower.Device also implement the
554ed0a11SShawn McCarney     org.freedesktop.DBus.Introspectable and org.freedesktop.DBus.Properties
654ed0a11SShawn McCarney     interfaces. Unless otherwise noted, an empty string or the value 0 in a
754ed0a11SShawn McCarney     property on this interface means not set."
854ed0a11SShawn McCarney
954ed0a11SShawn McCarneymethods:
1054ed0a11SShawn McCarney    - name: Refresh
1154ed0a11SShawn McCarney      description: >
1254ed0a11SShawn McCarney          "Refreshes the data collected from the power source. Callers need the
1354ed0a11SShawn McCarney           org.freedesktop.upower.refresh-power-source authorization"
1454ed0a11SShawn McCarney
1554ed0a11SShawn McCarney    - name: GetHistory
1654ed0a11SShawn McCarney      description: >
1754ed0a11SShawn McCarney          "Gets history for the power device that is persistent across
1854ed0a11SShawn McCarney           reboots."
1954ed0a11SShawn McCarney      parameters:
2054ed0a11SShawn McCarney          - name: type
2154ed0a11SShawn McCarney            type: string
2254ed0a11SShawn McCarney            description: >
2354ed0a11SShawn McCarney                "The type of history. Valid types are rate or charge."
2454ed0a11SShawn McCarney          - name: timespan
2554ed0a11SShawn McCarney            type: uint32
2654ed0a11SShawn McCarney            description: >
2754ed0a11SShawn McCarney                "The amount of data to return in seconds, or 0 for all."
2854ed0a11SShawn McCarney          - name: resolution
2954ed0a11SShawn McCarney            type: uint32
3054ed0a11SShawn McCarney            description: >
31*a1347418SPatrick Williams                "The approximate number of points to return. A higher resolution
32*a1347418SPatrick Williams                is
3354ed0a11SShawn McCarney                 more accurate, at the expense of plotting speed."
3454ed0a11SShawn McCarney      returns:
3554ed0a11SShawn McCarney          - name: data
3654ed0a11SShawn McCarney            type: array[struct[uint32, double, uint32]]
3754ed0a11SShawn McCarney            description: >
3854ed0a11SShawn McCarney                "The history data for the power device, if the device supports
39*a1347418SPatrick Williams                 history. Data is ordered from the earliest in time, to the
40*a1347418SPatrick Williams                newest
4154ed0a11SShawn McCarney                 data point. Each element contains the following members:
42*a1347418SPatrick Williams                   time: The time value in seconds from the gettimeofday()
43*a1347418SPatrick Williams                method.
44*a1347418SPatrick Williams                   value: The data value, for instance the rate in W or the
45*a1347418SPatrick Williams                charge
4654ed0a11SShawn McCarney                          in %.
4754ed0a11SShawn McCarney                   state: The state of the device, for instance charging or
4854ed0a11SShawn McCarney                          discharging."
4954ed0a11SShawn McCarney
5054ed0a11SShawn McCarney    - name: GetStatistics
5154ed0a11SShawn McCarney      description: >
5254ed0a11SShawn McCarney          "Gets statistics for the power device that may be interesting to show
5354ed0a11SShawn McCarney           on a graph in the session."
5454ed0a11SShawn McCarney      parameters:
5554ed0a11SShawn McCarney          - name: type
5654ed0a11SShawn McCarney            type: string
5754ed0a11SShawn McCarney            description: >
5854ed0a11SShawn McCarney                "The mode for the statistics. Valid types are charging or
5954ed0a11SShawn McCarney                 discharging."
6054ed0a11SShawn McCarney      returns:
6154ed0a11SShawn McCarney          - name: data
6254ed0a11SShawn McCarney            type: array[struct[double, double]]
6354ed0a11SShawn McCarney            description: >
64*a1347418SPatrick Williams                "The statistics data for the power device. Each element contains
65*a1347418SPatrick Williams                the
6654ed0a11SShawn McCarney                 following members:
6754ed0a11SShawn McCarney                   value: The value of the percentage point, usually in seconds.
6854ed0a11SShawn McCarney                   accuracy: The accuracy of the prediction in percent."
6954ed0a11SShawn McCarney
7054ed0a11SShawn McCarneyproperties:
7154ed0a11SShawn McCarney    - name: NativePath
7254ed0a11SShawn McCarney      default: ""
7354ed0a11SShawn McCarney      type: string
7454ed0a11SShawn McCarney      description: >
7554ed0a11SShawn McCarney          "OS specific native path of the power source. On Linux this is the
7654ed0a11SShawn McCarney           sysfs path, for example
7754ed0a11SShawn McCarney           /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0. Is
7854ed0a11SShawn McCarney           blank if the device is being driven by a user space driver."
7954ed0a11SShawn McCarney    - name: Vendor
8054ed0a11SShawn McCarney      default: ""
8154ed0a11SShawn McCarney      type: string
8254ed0a11SShawn McCarney      description: >
8354ed0a11SShawn McCarney          "Name of the vendor of the battery."
8454ed0a11SShawn McCarney    - name: Model
8554ed0a11SShawn McCarney      default: ""
8654ed0a11SShawn McCarney      type: string
8754ed0a11SShawn McCarney      description: >
8854ed0a11SShawn McCarney          "Name of the model of this battery."
8954ed0a11SShawn McCarney    - name: Serial
9054ed0a11SShawn McCarney      default: ""
9154ed0a11SShawn McCarney      type: string
9254ed0a11SShawn McCarney      description: >
9354ed0a11SShawn McCarney          "Unique serial number of the battery."
9454ed0a11SShawn McCarney    - name: UpdateTime
9554ed0a11SShawn McCarney      default: 0
9654ed0a11SShawn McCarney      type: uint64
9754ed0a11SShawn McCarney      description: >
9854ed0a11SShawn McCarney          "The point in time (seconds since the Epoch Jan 1, 1970 0:00 UTC)
9954ed0a11SShawn McCarney           that data was read from the power source."
10054ed0a11SShawn McCarney    - name: Type
10154ed0a11SShawn McCarney      default: 0
10254ed0a11SShawn McCarney      type: uint32
10354ed0a11SShawn McCarney      description: >
10454ed0a11SShawn McCarney          "Type of power source.
10554ed0a11SShawn McCarney              0: Unknown
10654ed0a11SShawn McCarney              1: Line Power
10754ed0a11SShawn McCarney              2: Battery
10854ed0a11SShawn McCarney              3: Ups
10954ed0a11SShawn McCarney              4: Monitor
11054ed0a11SShawn McCarney              5: Mouse
11154ed0a11SShawn McCarney              6: Keyboard
11254ed0a11SShawn McCarney              7: Pda
11354ed0a11SShawn McCarney              8: Phone"
11454ed0a11SShawn McCarney    - name: PowerSupply
11554ed0a11SShawn McCarney      default: false
11654ed0a11SShawn McCarney      type: boolean
11754ed0a11SShawn McCarney      description: >
11854ed0a11SShawn McCarney          "If the power device is used to supply the system. This would be set
11954ed0a11SShawn McCarney           TRUE for laptop batteries and UPS devices, but set FALSE for wireless
12054ed0a11SShawn McCarney           mice or PDAs."
12154ed0a11SShawn McCarney    - name: HasHistory
12254ed0a11SShawn McCarney      default: false
12354ed0a11SShawn McCarney      type: boolean
12454ed0a11SShawn McCarney      description: >
12554ed0a11SShawn McCarney          "If the power device has history."
12654ed0a11SShawn McCarney    - name: HasStatistics
12754ed0a11SShawn McCarney      default: false
12854ed0a11SShawn McCarney      type: boolean
12954ed0a11SShawn McCarney      description: >
13054ed0a11SShawn McCarney          "If the power device has statistics."
13154ed0a11SShawn McCarney    - name: Online
13254ed0a11SShawn McCarney      default: false
13354ed0a11SShawn McCarney      type: boolean
13454ed0a11SShawn McCarney      description: >
13554ed0a11SShawn McCarney          "Whether power is currently being provided through line power. This
13654ed0a11SShawn McCarney           property is only valid if the property type has the value
13754ed0a11SShawn McCarney           'line-power'."
13854ed0a11SShawn McCarney    - name: Energy
13954ed0a11SShawn McCarney      default: 0.0
14054ed0a11SShawn McCarney      type: double
14154ed0a11SShawn McCarney      description: >
14254ed0a11SShawn McCarney          "Amount of energy (measured in Wh) currently available in the power
14354ed0a11SShawn McCarney           source. This property is only valid if the property type has the
14454ed0a11SShawn McCarney           value 'battery'."
14554ed0a11SShawn McCarney    - name: EnergyEmpty
14654ed0a11SShawn McCarney      default: 0.0
14754ed0a11SShawn McCarney      type: double
14854ed0a11SShawn McCarney      description: >
14954ed0a11SShawn McCarney          "Amount of energy (measured in Wh) in the power source when it's
15054ed0a11SShawn McCarney           considered to be empty. This property is only valid if the property
15154ed0a11SShawn McCarney           type has the value 'battery'."
15254ed0a11SShawn McCarney    - name: EnergyFull
15354ed0a11SShawn McCarney      default: 0.0
15454ed0a11SShawn McCarney      type: double
15554ed0a11SShawn McCarney      description: >
15654ed0a11SShawn McCarney          "Amount of energy (measured in Wh) in the power source when it's
15754ed0a11SShawn McCarney           considered full. This property is only valid if the property type
15854ed0a11SShawn McCarney           has the value 'battery'."
15954ed0a11SShawn McCarney    - name: EnergyFullDesign
16054ed0a11SShawn McCarney      default: 0.0
16154ed0a11SShawn McCarney      type: double
16254ed0a11SShawn McCarney      description: >
16354ed0a11SShawn McCarney          "Amount of energy (measured in Wh) the power source is designed to
16454ed0a11SShawn McCarney           hold when it's considered full. This property is only valid if the
16554ed0a11SShawn McCarney           property type has the value 'battery'."
16654ed0a11SShawn McCarney    - name: EnergyRate
16754ed0a11SShawn McCarney      default: 0.0
16854ed0a11SShawn McCarney      type: double
16954ed0a11SShawn McCarney      description: >
17054ed0a11SShawn McCarney          "Amount of energy being drained from the source, measured in W. If
17154ed0a11SShawn McCarney           positive, the source is being discharged, if negative it's being
17254ed0a11SShawn McCarney           charged. This property is only valid if the property type has the
17354ed0a11SShawn McCarney           value 'battery'."
17454ed0a11SShawn McCarney    - name: Voltage
17554ed0a11SShawn McCarney      default: 0.0
17654ed0a11SShawn McCarney      type: double
17754ed0a11SShawn McCarney      description: >
17854ed0a11SShawn McCarney          "Voltage in the Cell or being recorded by the meter."
17954ed0a11SShawn McCarney    - name: Luminosity
18054ed0a11SShawn McCarney      default: 0.0
18154ed0a11SShawn McCarney      type: double
18254ed0a11SShawn McCarney      description: >
18354ed0a11SShawn McCarney          "Luminosity being recorded by the meter."
18454ed0a11SShawn McCarney    - name: TimeToEmpty
18554ed0a11SShawn McCarney      default: 0
18654ed0a11SShawn McCarney      type: int64
18754ed0a11SShawn McCarney      description: >
18854ed0a11SShawn McCarney          "Number of seconds until the power source is considered empty. Is set
18954ed0a11SShawn McCarney           to 0 if unknown. This property is only valid if the property type
19054ed0a11SShawn McCarney           has the value 'battery'."
19154ed0a11SShawn McCarney    - name: TimeToFull
19254ed0a11SShawn McCarney      default: 0
19354ed0a11SShawn McCarney      type: int64
19454ed0a11SShawn McCarney      description: >
19554ed0a11SShawn McCarney          "Number of seconds until the power source is considered full. Is set
19654ed0a11SShawn McCarney           to 0 if unknown. This property is only valid if the property type
19754ed0a11SShawn McCarney           has the value 'battery'."
19854ed0a11SShawn McCarney    - name: Percentage
19954ed0a11SShawn McCarney      default: 0.0
20054ed0a11SShawn McCarney      type: double
20154ed0a11SShawn McCarney      description: >
20254ed0a11SShawn McCarney          "The amount of energy left in the power source expressed as a
20354ed0a11SShawn McCarney           percentage between 0 and 100. Typically this is the same as (energy -
20454ed0a11SShawn McCarney           energy-empty) / (energy-full - energy-empty). However, some primitive
20554ed0a11SShawn McCarney           power sources are capable of only reporting percentages and in this
20654ed0a11SShawn McCarney           case the energy-* properties will be unset while this property is
20754ed0a11SShawn McCarney           set. This property is only valid if the property type has the value
20854ed0a11SShawn McCarney           'battery'."
20954ed0a11SShawn McCarney    - name: Temperature
21054ed0a11SShawn McCarney      default: 0.0
21154ed0a11SShawn McCarney      type: double
21254ed0a11SShawn McCarney      description: >
21354ed0a11SShawn McCarney          "The temperature of the device in degrees Celsius. This property is
21454ed0a11SShawn McCarney           only valid if the property type has the value 'battery'."
21554ed0a11SShawn McCarney    - name: IsPresent
21654ed0a11SShawn McCarney      default: false
21754ed0a11SShawn McCarney      type: boolean
21854ed0a11SShawn McCarney      description: >
21954ed0a11SShawn McCarney          "If the power source is present in the bay. This field is required as
22054ed0a11SShawn McCarney           some batteries are hot-removable, for example expensive UPS and most
22154ed0a11SShawn McCarney           laptop batteries. This property is only valid if the property type
22254ed0a11SShawn McCarney           has the value 'battery'."
22354ed0a11SShawn McCarney    - name: State
22454ed0a11SShawn McCarney      default: 0
22554ed0a11SShawn McCarney      type: uint32
22654ed0a11SShawn McCarney      description: >
22754ed0a11SShawn McCarney          "The battery power state.
22854ed0a11SShawn McCarney              0: Unknown
22954ed0a11SShawn McCarney              1: Charging
23054ed0a11SShawn McCarney              2: Discharging
23154ed0a11SShawn McCarney              3: Empty
23254ed0a11SShawn McCarney              4: Fully charged
23354ed0a11SShawn McCarney              5: Pending charge
23454ed0a11SShawn McCarney              6: Pending discharge
23554ed0a11SShawn McCarney           This property is only valid if the property type has the value
23654ed0a11SShawn McCarney           'battery'."
23754ed0a11SShawn McCarney    - name: IsRechargeable
23854ed0a11SShawn McCarney      default: false
23954ed0a11SShawn McCarney      type: boolean
24054ed0a11SShawn McCarney      description: >
24154ed0a11SShawn McCarney          "If the power source is rechargeable. This property is only valid if
24254ed0a11SShawn McCarney           the property type has the value 'battery'."
24354ed0a11SShawn McCarney    - name: Capacity
24454ed0a11SShawn McCarney      default: 0.0
24554ed0a11SShawn McCarney      type: double
24654ed0a11SShawn McCarney      description: >
24754ed0a11SShawn McCarney          "The capacity of the power source expressed as a percentage between 0
24854ed0a11SShawn McCarney           and 100. The capacity of the battery will reduce with age. A capacity
24954ed0a11SShawn McCarney           value less than 75% is usually a sign that you should renew your
25054ed0a11SShawn McCarney           battery. Typically this value is the same as (full-design / full) *
25154ed0a11SShawn McCarney           100. However, some primitive power sources are not capable reporting
25254ed0a11SShawn McCarney           capacity and in this case the capacity property will be unset. This
25354ed0a11SShawn McCarney           property is only valid if the property type has the value 'battery'."
25454ed0a11SShawn McCarney    - name: Technology
25554ed0a11SShawn McCarney      default: 0
25654ed0a11SShawn McCarney      type: uint32
25754ed0a11SShawn McCarney      description: >
25854ed0a11SShawn McCarney          "Technology used in the battery:
25954ed0a11SShawn McCarney             0: Unknown
26054ed0a11SShawn McCarney             1: Lithium ion
26154ed0a11SShawn McCarney             2: Lithium polymer
26254ed0a11SShawn McCarney             3: Lithium iron phosphate
26354ed0a11SShawn McCarney             4: Lead acid
26454ed0a11SShawn McCarney             5: Nickel cadmium
26554ed0a11SShawn McCarney             6: Nickel metal hydride
26654ed0a11SShawn McCarney           This property is only valid if the property type has the value
26754ed0a11SShawn McCarney           'battery'."
26854ed0a11SShawn McCarney    - name: WarningLevel
26954ed0a11SShawn McCarney      default: 0
27054ed0a11SShawn McCarney      type: uint32
27154ed0a11SShawn McCarney      description: >
27254ed0a11SShawn McCarney          "Warning level of the battery:
27354ed0a11SShawn McCarney              0: Unknown
27454ed0a11SShawn McCarney              1: None
27554ed0a11SShawn McCarney              2: Discharging (only for UPSes)
27654ed0a11SShawn McCarney              3: Low
27754ed0a11SShawn McCarney              4: Critical
27854ed0a11SShawn McCarney              5: Action"
27954ed0a11SShawn McCarney    - name: BatteryLevel
28054ed0a11SShawn McCarney      default: 0
28154ed0a11SShawn McCarney      type: uint32
28254ed0a11SShawn McCarney      description: >
28354ed0a11SShawn McCarney          "Level of the battery:
28454ed0a11SShawn McCarney              0: Unknown
285*a1347418SPatrick Williams              1: None (the battery does not use a coarse level of battery
286*a1347418SPatrick Williams          reporting)
28754ed0a11SShawn McCarney              3: Low
28854ed0a11SShawn McCarney              4: Critical
28954ed0a11SShawn McCarney              6: Normal
29054ed0a11SShawn McCarney              7: High
29154ed0a11SShawn McCarney              8: Full"
29254ed0a11SShawn McCarney    - name: IconName
29354ed0a11SShawn McCarney      default: ""
29454ed0a11SShawn McCarney      type: string
29554ed0a11SShawn McCarney      description: >
29654ed0a11SShawn McCarney          "An icon name, following the Icon Naming Specification"
297