1f5ef0f90SShawn McCarney# action 2f5ef0f90SShawn McCarney 3f5ef0f90SShawn McCarney## Description 40dbce568SPatrick Williams 5f5ef0f90SShawn McCarneyAction to execute. 6f5ef0f90SShawn McCarney 7f5ef0f90SShawn McCarneyActions are executed to perform the following regulator operations: 80dbce568SPatrick Williams 90dbce568SPatrick Williams- [presence_detection](presence_detection.md) 100dbce568SPatrick Williams- [configuration](configuration.md) 110dbce568SPatrick Williams- [sensor_monitoring](sensor_monitoring.md) 120dbce568SPatrick Williams- [phase_fault_detection](phase_fault_detection.md) 13f5ef0f90SShawn McCarney 14f5ef0f90SShawn McCarneyMany actions read from or write to a hardware device. Initially this is the 15f5ef0f90SShawn McCarney[device](device.md) that contains the regulator operation. However, the device 16f5ef0f90SShawn McCarneycan be changed using the [set_device](set_device.md) action. 17f5ef0f90SShawn McCarney 18f5ef0f90SShawn McCarney## Properties 190dbce568SPatrick Williams 20f5ef0f90SShawn McCarney| Name | Required | Type | Description | 210dbce568SPatrick Williams| :----------------------- | :-----------------: | :------------------------------------------------------ | :------------------------------------------------------------------- | 22f5ef0f90SShawn McCarney| comments | no | array of strings | One or more comment lines describing this action. | 23f5ef0f90SShawn McCarney| and | see [notes](#notes) | array of actions | Action type [and](and.md). | 24f5ef0f90SShawn McCarney| compare_presence | see [notes](#notes) | [compare_presence](compare_presence.md) | Action type [compare_presence](compare_presence.md). | 25f5ef0f90SShawn McCarney| compare_vpd | see [notes](#notes) | [compare_vpd](compare_vpd.md) | Action type [compare_vpd](compare_vpd.md). | 267e2a549eSShawn McCarney| i2c_capture_bytes | see [notes](#notes) | [i2c_capture_bytes](i2c_capture_bytes.md) | Action type [i2c_capture_bytes](i2c_capture_bytes.md). | 27f5ef0f90SShawn McCarney| i2c_compare_bit | see [notes](#notes) | [i2c_compare_bit](i2c_compare_bit.md) | Action type [i2c_compare_bit](i2c_compare_bit.md). | 28f5ef0f90SShawn McCarney| i2c_compare_byte | see [notes](#notes) | [i2c_compare_byte](i2c_compare_byte.md) | Action type [i2c_compare_byte](i2c_compare_byte.md). | 29f5ef0f90SShawn McCarney| i2c_compare_bytes | see [notes](#notes) | [i2c_compare_bytes](i2c_compare_bytes.md) | Action type [i2c_compare_bytes](i2c_compare_bytes.md). | 30f5ef0f90SShawn McCarney| i2c_write_bit | see [notes](#notes) | [i2c_write_bit](i2c_write_bit.md) | Action type [i2c_write_bit](i2c_write_bit.md). | 31f5ef0f90SShawn McCarney| i2c_write_byte | see [notes](#notes) | [i2c_write_byte](i2c_write_byte.md) | Action type [i2c_write_byte](i2c_write_byte.md). | 32f5ef0f90SShawn McCarney| i2c_write_bytes | see [notes](#notes) | [i2c_write_bytes](i2c_write_bytes.md) | Action type [i2c_write_bytes](i2c_write_bytes.md). | 33f5ef0f90SShawn McCarney| if | see [notes](#notes) | [if](if.md) | Action type [if](if.md). | 347e2a549eSShawn McCarney| log_phase_fault | see [notes](#notes) | [log_phase_fault](log_phase_fault.md) | Action type [log_phase_fault](log_phase_fault.md). | 35f5ef0f90SShawn McCarney| not | see [notes](#notes) | action | Action type [not](not.md). | 36f5ef0f90SShawn McCarney| or | see [notes](#notes) | array of actions | Action type [or](or.md). | 37f5ef0f90SShawn McCarney| pmbus_read_sensor | see [notes](#notes) | [pmbus_read_sensor](pmbus_read_sensor.md) | Action type [pmbus_read_sensor](pmbus_read_sensor.md). | 38f5ef0f90SShawn McCarney| 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). | 39f5ef0f90SShawn McCarney| run_rule | see [notes](#notes) | string | Action type [run_rule](run_rule.md). | 40f5ef0f90SShawn McCarney| set_device | see [notes](#notes) | string | Action type [set_device](set_device.md). | 41f5ef0f90SShawn McCarney 42f5ef0f90SShawn McCarney### Notes 430dbce568SPatrick Williams 440dbce568SPatrick Williams- You must specify exactly one action type property, such as "i2c_write_byte" or 450dbce568SPatrick Williams "run_rule". 46f5ef0f90SShawn McCarney 47f5ef0f90SShawn McCarney## Return Value 480dbce568SPatrick Williams 49f5ef0f90SShawn McCarneyWhen the action completes, it returns a true or false value. The documentation 50f5ef0f90SShawn McCarneyfor the specified action type describes what value will be returned. 51f5ef0f90SShawn McCarney 52f5ef0f90SShawn McCarney## Examples 530dbce568SPatrick Williams 54*6151c286SGeorge Liu```json 55f5ef0f90SShawn McCarney{ 56f5ef0f90SShawn McCarney "comments": ["Set frequency to 800kHz"], 57f5ef0f90SShawn McCarney "i2c_write_byte": { 58f5ef0f90SShawn McCarney "register": "0x2C", 59f5ef0f90SShawn McCarney "value": "0x0F" 60f5ef0f90SShawn McCarney } 61f5ef0f90SShawn McCarney} 62*6151c286SGeorge Liu``` 63f5ef0f90SShawn McCarney 64*6151c286SGeorge Liu```json 65f5ef0f90SShawn McCarney{ 66f5ef0f90SShawn McCarney "run_rule": "set_voltage_rule" 67f5ef0f90SShawn McCarney} 68f5ef0f90SShawn McCarney``` 69