Skip to content

3 - Cleanup architecture to support future use cases

Compare
Choose a tag to compare
@sparten11740 sparten11740 released this 12 Dec 17:39
· 49 commits to main since this release

This release changes the format of the config and aims for a cleaner architecture by moving transformation logic out of the connectors (sources/sinks). It will therefore ease the implementation of future use cases (for example if one wanted to use an MqttSource to select a profile in OpenRGB one wouldn't want to apply the Color decoding that was previously inherent to the MqttSource)

The Sources and Sinks properties in the config file are now arrays that contain sources or sinks respectively of all types (discriminated by a type attribute).

The MqttSource no longer deals with the value transformation itself - meaning the extraction of a hex string from the response json and decoding thereof to a Color type.

For that purpose two transformations were added (JsonPath, Color). Transformations can be added in an array to both, sources and sinks, and will be executed in order. Each transformation is applied to the value that is returned from the previous transformation (if there is one) or the value emitted from the source in case of the first transformation. Sink transformations transform any value received by the sink before the value is passed on to the sink.