Open Lakritzator opened 8 years ago
I have X-ed out the to address, just in case...
This now works, there is a
public event EventHandler<string> OnActivityChanged;
On the HarmonyClient which informs you when the activity is changed, so when it's really active not while switching.
Actually there still is an issue in the setActivity usage, this sends "100" responses and these should be ignored.
When changing the activity the following messages are send:
<iq xmlns="jabber:client" to="1" id="agsXMPP_3" type="get"><oa xmlns="connect.logitech.com" errorcode="200" mime="vnd.logitech.harmony/vnd.logitech.harmony.engine?startactivity" errorstring="OK" /></iq>
<iq xmlns="jabber:client" id="agsXMPP_3" type="get"><oa xmlns="connect.logitech.com" errorcode="100" mime="harmony.engine?startActivity" errorstring="Continue"><![CDATA[done=1:total=10:deviceId=29923836]]></oa></iq>
<iq xmlns="jabber:client" id="agsXMPP_3" type="get"><oa xmlns="connect.logitech.com" errorcode="100" mime="harmony.engine?startActivity" errorstring="Continue"><![CDATA[done=2:total=10:deviceId=29923832]]></oa></iq>
<iq xmlns="jabber:client" id="agsXMPP_3" type="get"><oa xmlns="connect.logitech.com" errorcode="100" mime="harmony.engine?startActivity" errorstring="Continue"><![CDATA[done=3:total=10:deviceId=36988229]]></oa></iq>
<iq xmlns="jabber:client" id="agsXMPP_3" type="get"><oa xmlns="connect.logitech.com" errorcode="100" mime="harmony.engine?startActivity" errorstring="Continue"><![CDATA[done=4:total=10:deviceId=29923832]]></oa></iq>
<iq xmlns="jabber:client" id="agsXMPP_3" type="get"><oa xmlns="connect.logitech.com" errorcode="100" mime="harmony.engine?startActivity" errorstring="Continue"><![CDATA[done=5:total=10:deviceId=29923832]]></oa></iq>
<iq xmlns="jabber:client" id="agsXMPP_3" type="get"><oa xmlns="connect.logitech.com" errorcode="100" mime="harmony.engine?startActivity" errorstring="Continue"><![CDATA[done=6:total=10:deviceId=29923832]]></oa></iq>
<iq xmlns="jabber:client" id="agsXMPP_3" type="get"><oa xmlns="connect.logitech.com" errorcode="100" mime="harmony.engine?startActivity" errorstring="Continue"><![CDATA[done=7:total=10:deviceId=29923832]]></oa></iq>
<iq xmlns="jabber:client" id="agsXMPP_3" type="get"><oa xmlns="connect.logitech.com" errorcode="100" mime="harmony.engine?startActivity" errorstring="Continue"><![CDATA[done=8:total=10:deviceId=29923832]]></oa></iq>
<iq xmlns="jabber:client" id="agsXMPP_3" type="get"><oa xmlns="connect.logitech.com" errorcode="100" mime="harmony.engine?startActivity" errorstring="Continue"><![CDATA[done=9:total=10:deviceId=29923832]]></oa></iq>
<iq xmlns="jabber:client" id="agsXMPP_3" type="get"><oa xmlns="connect.logitech.com" errorcode="200" mime="harmony.engine?startActivity" errorstring="OK"><![CDATA[done=10:total=10:deviceId=29923833]]></oa></iq>
The first 200 makes the call work, but we could inform of progress changes. 1 of 10, 2 of 10 etc. Besides the activity changed event doesn't work when we send the change itself...
Besides the activity changed event doesn't work when we send the change itself...
I wonder if this is by design or if we are not doing the switch properly.
I have to admit I'm not using activities on my set up, well I have just the one activity. Therefore a lot of my work has been focused on using devices directly. I have not tested any of the activities related functionality.
When changing the activity and monitoring the messages send by the harmony hub, I can see the following.
This should be processed, to generate events.