1# action
2
3## Description
4Action to execute.
5
6Actions are executed to perform the following regulator operations:
7* [presence_detection](presence_detection.md)
8* [configuration](configuration.md)
9* [sensor_monitoring](sensor_monitoring.md)
10
11Many actions read from or write to a hardware device.  Initially this is the
12[device](device.md) that contains the regulator operation.  However, the device
13can be changed using the [set_device](set_device.md) action.
14
15## Properties
16| Name | Required | Type | Description |
17| :--- | :------: | :--- | :---------- |
18| comments | no | array of strings | One or more comment lines describing this action. |
19| and | see [notes](#notes) | array of actions | Action type [and](and.md). |
20| compare_presence | see [notes](#notes) | [compare_presence](compare_presence.md) | Action type [compare_presence](compare_presence.md). |
21| compare_vpd | see [notes](#notes) | [compare_vpd](compare_vpd.md) | Action type [compare_vpd](compare_vpd.md). |
22| i2c_compare_bit | see [notes](#notes) | [i2c_compare_bit](i2c_compare_bit.md) | Action type [i2c_compare_bit](i2c_compare_bit.md). |
23| i2c_compare_byte | see [notes](#notes) | [i2c_compare_byte](i2c_compare_byte.md) | Action type [i2c_compare_byte](i2c_compare_byte.md). |
24| i2c_compare_bytes | see [notes](#notes) | [i2c_compare_bytes](i2c_compare_bytes.md) | Action type [i2c_compare_bytes](i2c_compare_bytes.md). |
25| i2c_write_bit | see [notes](#notes) | [i2c_write_bit](i2c_write_bit.md) | Action type [i2c_write_bit](i2c_write_bit.md). |
26| i2c_write_byte | see [notes](#notes) | [i2c_write_byte](i2c_write_byte.md) | Action type [i2c_write_byte](i2c_write_byte.md). |
27| i2c_write_bytes | see [notes](#notes) | [i2c_write_bytes](i2c_write_bytes.md) | Action type [i2c_write_bytes](i2c_write_bytes.md). |
28| if | see [notes](#notes) | [if](if.md) | Action type [if](if.md). |
29| not | see [notes](#notes) | action | Action type [not](not.md). |
30| or | see [notes](#notes) | array of actions | Action type [or](or.md). |
31| pmbus_read_sensor | see [notes](#notes) | [pmbus_read_sensor](pmbus_read_sensor.md) | Action type [pmbus_read_sensor](pmbus_read_sensor.md). |
32| pmbus_write_vout_command | see [notes](#notes) | [pmbus_write_vout_command](pmbus_write_vout_command.md) | Action type [pmbus_write_vout_command](pmbus_write_vout_command.md). |
33| run_rule | see [notes](#notes) | string | Action type [run_rule](run_rule.md). |
34| set_device | see [notes](#notes) | string | Action type [set_device](set_device.md). |
35
36### Notes
37* You must specify exactly one action type property, such as "i2c_write_byte"
38  or "run_rule".
39
40## Return Value
41When the action completes, it returns a true or false value.  The documentation
42for the specified action type describes what value will be returned.
43
44## Examples
45```
46{
47  "comments": [ "Set frequency to 800kHz" ],
48  "i2c_write_byte": {
49    "register": "0x2C",
50    "value": "0x0F"
51  }
52}
53
54{
55  "run_rule": "set_voltage_rule"
56}
57```
58