1# compare_presence
2
3## Description
4
5Compares a hardware component's presence to an expected value. The hardware
6component must be a Field-Replaceable Unit (FRU).
7
8This action can be used for [presence_detection](presence_detection.md) of a
9[device](device.md). It can also be used in an [if](if.md) condition to execute
10actions based on FRU presence.
11
12## Properties
13
14| Name  | Required | Type                    | Description                                                                                                                                                                                                                                   |
15| :---- | :------: | :---------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
16| fru   |   yes    | string                  | Field-Replaceable Unit. Specify the relative D-Bus inventory path of the FRU. Full inventory paths begin with the root "/xyz/openbmc_project/inventory". Specify the relative path below the root, such as "system/chassis/motherboard/cpu3". |
17| value |   yes    | boolean (true or false) | Expected presence value.                                                                                                                                                                                                                      |
18
19## Return Value
20
21Returns true if the actual presence value equals the expected value, otherwise
22returns false.
23
24## Example
25
26```
27{
28  "comments": [ "Check if CPU3 is present" ],
29  "compare_presence": {
30    "fru": "system/chassis/motherboard/cpu3",
31    "value": true
32  }
33}
34```
35