CompositeDevice

CompositeDevice

new CompositeDevice(devices, kwdevices)

Source:
Represents a device composed of multiple devices like simple HATs, H-bridge motor controllers, robots composed of multiple motors, etc. The constructor accepts subordinate devices as positional or keyword arguments. Positional arguments form unnamed devices accessed via the (@link CompositeDevice#all|all) attribute, while keyword arguments are added to the device as named attributes.
Parameters:
Name Type Description
devices Array An Array of positional devices.
kwdevices Array An Array of tuples containing device name and device.

Extends

Methods

close()

Source:
Overrides:
Close all subordinate devices.

is_active() → {boolean}

Source:
Overrides:
Returns:
- An array of each subordinate devices active state.
Type
boolean

length() → {number}

Source:
Returns:
- The number of subordinate devices.
Type
number

namedtuple() → {Array}

Source:
Returns:
- An array of subordinate device names.
Type
Array

value() → {Array}

Source:
Overrides:
Returns:
- An array of all subordinate device values.
Type
Array