Devices Lua API

From Off Grid Wiki
Revision as of 16:03, 26 June 2017 by Rich (talk | contribs) (Rich moved page Lua Apis/Devices Lua API to Devices Lua API without leaving a redirect: removing sub-pages)
Jump to navigation Jump to search

Template:OffGridDocStart

Devices

Description

The Devices API is used to control the behavior of provided devices in the level kit each of these calls will have a slightly different response to each of these calls. Please see the devices page for a full break down.

Functions

SetPower

Devices.SetPower(deviceName, state)

Expected parameter types

deviceName string
state bool

Description: Change the powered on state of the device

Returns: Nothing

Notes: See provided devices page to see how each device handles this call

GetPower

Devices.GetPower(deviceName)

Expected parameter types

deviceName string

Description: Get the powered on state of the device

Returns: If the device is currently powered on

SetActive

Devices.SetActive(deviceName, state)

Expected parameter types

deviceName string
state bool

Description: Change the active state of the device

Returns: Nothing

Notes: See provided devices page to see how each device handles this call

GetActive

Devices.GetActive(deviceName)

Expected parameter types

deviceName string

Description: Get the active state of the device

Returns: If the device is currently active

RunOnce

Devices.RunOnce(deviceName)

Expected parameter types

deviceName string

Description: Trigger a single update of the device

Returns: Nothing

Notes: See provided devices page to see how each device handles this call

SetAmok

Devices.SetAmok(deviceName, state)

Expected parameter types

deviceName string
state bool

Description: Begin an 'Amok' state, cause the device to act in an unstable/broken manor

Returns: Nothing

Notes: See provided devices page to see how each device handles this call

GetAmok

Devices.GetAmok(deviceName)

Expected parameter types

deviceName string

Description: Get the 'Amok' state of the device

Returns: If the device is currently running 'Amok'

SetValue

Devices.SetValue(deviceName, newValue)

Expected parameter types

deviceName string
newValue string

Description: Pass a string value to the device

Returns: Nothing

Notes: See provided devices page to see how each device handles this call

GetValue

Devices.GetValue(deviceName)

Expected parameter types

deviceName string

Description: Get the current value of the device

Returns: The value of the device


Docs last hacked together on: 09/05/2017 12:46