Skip to content

collection_input_device

messageflux.iodevices.collection_device_wrapper.collection_input_device

CollectionInputDevice

CollectionInputDevice(
    device_manager, device_name, input_devices
)

Bases: InputDevice['CollectionInputDeviceManager']

this class reads from a collection of input devices.

it iterates over the collection, and returns the first successful item read from the device

ctor

Parameters:

Name Type Description Default
device_name str

the name of this device

required
input_devices Collection[InputDevice]

the devices that this aggregate device reads from

required

close

close()

closes the connection to device

CollectionInputDeviceManager

CollectionInputDeviceManager(
    inner_managers, collection_maker, **kwargs
)

Bases: InputDeviceManager[CollectionInputDevice]

This class is used to create Collection InputDevices

This class is used to create Collection InputDevices

Parameters:

Name Type Description Default
inner_managers List[InputDeviceManager]

the actual InputDeviceManager instances to generate devices from

required
collection_maker Callable[[List[InputDevice]], Collection[InputDevice]]

the callable to make the iterable collection from list of devices

required

connect

connect()

connects to device manager

disconnect

disconnect()

disconnects from the device manager