I'm writing a C# program in HG and I'm having a problem with:
When.WebServiceCallReceived("HomeAutomation.HomeGenie.Automation", ( args ) =>
{
return true;
}
Once I enable my program, without doing anything else, the security system stops responding to its control widget though the widget itself changes Armed/Disarmed. To get the security system to work again, I have to disable my program and restart the security system. If I comment out the When.WebserviceCallReceived section in my program, everything works fine. I notice that the security system also uses "HomeAutomation.HomeGenie.Automation" but I thought my "return true" would allow the call to drop through.
So, I thought maybe I could use something different than "HomeAutomation.HomeGenie.Automation". I noticed other programs use a more specific string, like: "RaspberryPi.Gpio". But I don't know what to use. My program is in group: "Messaging and Social" and is named: "Android Push Notification".
I have another When.WebServiceCallReceived("APNRequest", ( args ) => which works fine from a browser call and does not seem to interfere with the security system.
The reason I need WebServiceCallReceived("HomeAutomation.HomeGenie.Automation", ( args ) => is so that I can have a control widget which, when pressed, will execute the code in the WebServiceCallReceived. If I ignore the issue with the security system and go ahead with the WebServiceCallReceived, and implement a switch widget via:
Program.AddControlWidget("homegenie/generic/switch");
then I can see the WebServiceCallReceived working fine. But, of course, I need my security system working too.
I'd also like to just use default widget as I don't need a switch, just a button. But when I tried the default widget, the WebServiceCallReceived in my program did not seem to get called.
So, any ideas on the WebServiceCallReceived and/or the default widget?
Any help would be greatly appreciated.
Thanks,
John