Skip to content

transformer_input_device

messageflux.iodevices.transformer_device_wrapper.transformer_input_device

InputTransformerBase

transformer for input devices

connect

connect()

this method is called when the transformer device manager is connected

disconnect

disconnect()

this method is called when the transformer device manager is disconnected

transform_incoming_message abstractmethod

transform_incoming_message(input_device, read_result)

Transform the message that was received from the underlying device.

Parameters:

Name Type Description Default
input_device TransformerInputDevice

the input device that the transformer runs on

required
read_result ReadResult

the original ReadResult received from the underlying device

required

Returns:

Type Description
ReadResult

the transformed ReadResult

TransformerInputDevice

TransformerInputDevice(
    manager, name, inner_device, transformer
)

Bases: InputDevice['TransformerInputDeviceManager']

an input device that transforms the input

Parameters:

Name Type Description Default
manager TransformerInputDeviceManager

the input device manager

required
name str

the name of this device

required
inner_device InputDevice

the inner device that it wraps

required
transformer InputTransformerBase

the transformer to use to transform the incoming messages

required

close

close()

closes the inner device

TransformerInputDeviceManager

TransformerInputDeviceManager(
    inner_device_manager, transformer, **kwargs
)

Bases: InputDeviceManager[TransformerInputDevice]

a wrapper input device manager, that wraps the devices in transformer input devices

Parameters:

Name Type Description Default
inner_device_manager InputDeviceManager

the inner device manager

required
transformer InputTransformerBase

the input transformer to use

required

connect

connect()

connects the inner device manager and the transformer

disconnect

disconnect()

disconnects the inner device manager and the transformer