Use didReceiveSettings instead of sendToPropertyInspector
As far as I can see, you use sendToPlugin/sendToPropertyInspector for the communication between the Property Inspector and the plugin. You could simplify this code but using the setSettings API:
-
When the setSettings API is called from the plugin, the Property Inspector will automatically receive a didReceiveSettings callback with the new settings. See: https://developer.elgato.com/documentation/stream-deck/sdk/events-received/#didreceivesettings
-
When the Property Inspector is displayed, the settings are passed directly to the Property Inspector in the inActionInfo parameter. See: https://developer.elgato.com/documentation/stream-deck/sdk/registration-procedure/#inactioninfo-parameter
You could use this to simplify the communication between the plugin and Property Inspector.