First, thanks for writing mcsMQTT! I've been getting started with it by using it communicate with a few HA Switchplates as noted in the provided link.
I'm making good use of your script function "SendMqttMessage" to initialize the displays with the correct label text, colors, etc.
I was wondering if you had thought about providing the ability to register a script/function to be called whenever a specified topic was received.
Something like...
hs.PluginFunction("mcsMQTT", "", "RegisterTopicReceivedScript",{"MyScriptName", "MyFunctionName", "MyMQTTTopic"})
Then, whenever the topic is received, the plugin would call the specified script function and pass it the topic received.
Having this ability would save me a fair amount of time and effort in creating and maintaining a bunch of events to handle button presses, etc. since they could all be handled in one script quite efficiently.
What do you think?
Thanks,
Yoyo
I'm making good use of your script function "SendMqttMessage" to initialize the displays with the correct label text, colors, etc.
I was wondering if you had thought about providing the ability to register a script/function to be called whenever a specified topic was received.
Something like...
hs.PluginFunction("mcsMQTT", "", "RegisterTopicReceivedScript",{"MyScriptName", "MyFunctionName", "MyMQTTTopic"})
Then, whenever the topic is received, the plugin would call the specified script function and pass it the topic received.
Having this ability would save me a fair amount of time and effort in creating and maintaining a bunch of events to handle button presses, etc. since they could all be handled in one script quite efficiently.
What do you think?
Thanks,
Yoyo
Comment