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