Mode change subscription bug, at least in docs

I have noticed that when using subscribe(location, “mode”, modeChangeHandler) it is sometimes hard to unsubscribe.

This subscribe format is in the documentation here
under “Mode Events”, but does not match any of the subscribe signatures documented here:

Can we use the signature (Location location, String attributeNameAndValue, handlerMethod)? If so why isn’t it documented and why is it sometimes hard to unsubscribe?

Related question. Is the new mode id contained anywhere in the Event that is triggered? I can only find the mode name, in the value attribute.

That signature doesn’t apply to Location Events, as show by the documentation, only eventName is valid as the second parameter.

And eventName for Location is something like “Mode”, “alarmSystemStatus”, and perhaps a few other secret ones.

Location is a very different Object than Device (and other objects that you can subscribe to). The signature is dependent on the Object Type.

Thanks, but that signature you quoted was missing from the docs as of two days ago (verified by google cache). I’m glad to see that it is official. However I do think there is an issue when unsubscribing from that signature. I will revert to it, as opposed to (Location, handler), and see if I can confirm.


I believe that the Docs are in a public GitHub repo… below; but that’s one way to verify you’re not going crazy :wink:.