Relay

set_state

Parameters: state Should be an integer value of 1 or 0.

Sets the state of the relay on (open) or off (closed).

is_on

Returns true if the relay is on, false if the relay is off.

turn_on

Turns the relay on.

turn_off

Turns the relay off.

toggle

Toggles the state of the relay. (If the relay is on, then it will be turned off, if it is off, then it will be turned on.)