new CompositeOutputDevice(devicesopt, kwdevicesopt, optionsopt)
Extends CompositeDevice with on, off,
and toggle methods for controlling subordinate output devices
and extends value to be writable.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
devices |
Array |
<optional> |
An array of devices that create this composite device. |
kwdevices |
Array |
<optional> |
An array of tuples that contain the device name and device eg ['red', new LED(1)]. |
options |
Array |
<optional> |
- |
Extends
Methods
close()
- Source:
- Inherited From:
Close all subordinate devices.
is_active() → {boolean}
- Source:
- Inherited From:
Returns:
- An array of each subordinate devices active state.
- Type
- boolean
length() → {number}
- Source:
- Inherited From:
Returns:
- The number of subordinate devices.
- Type
- number
namedtuple() → {Array}
- Source:
- Inherited From:
Returns:
- An array of subordinate device names.
- Type
- Array
off()
Calls the off method on all child devices within this composite device.
on()
Calls the on method on all child devices within this composite device.
toggle()
Calls the toggle method on all child devices within this composite device.
value(valueopt) → {Array}
- Source:
- Overrides:
When value is undefined then the function returns the value of all child
devices as an array.
When value is set, all child devices will have their value set according
to the value array.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
Array |
<optional> |
The value to set all of the child devices to. |
Returns:
- The current value of each output device returned as an array.
- Type
- Array