emorydunn / StreamDeckPlugin

A library for creating Stream Deck plugins in Swift.
https://emorydunn.github.io/StreamDeckPlugin/
MIT License
63 stars 7 forks source link

Decoding Events Fails on Non-String Settings #13

Closed emorydunn closed 1 year ago

emorydunn commented 1 year ago

Settings are hard-coded to decode as [String:String], however if the PI sends other (valid) JSON types back the event will fail to decode. For instance, checkboxes might be sent as {"someKey": true}.

Settings should support any valid JSON. The simple fix is to deliver a Data blob to the Action to decode itself. A nicer solution would be to allow the Action to declare a Settings type that the plugin could then decode before forwarding to an Action.