Agh you’ve figured out that I like to explain the quirks and history of our device platform. Just want to point out that my main work is on hub firmware so although I’ve interacted with this for many years, none of it is my fault
tl;dr it’s vestigial
The “updated” event was originally automatically sent by the platform whenever a device record was updated in the database, to notify the mobile app that it needed to refresh the device’s info from the server. I’m not sure if it was intentional that it go through the handler’s parse method or not – at that point all events did.
After we started to get a bunch of exceptions about how the Z-Wave library couldn’t parse “command:upda payload:ted”, and had to add checks for it in parse methods, we decided to switch to a new hub event “DeviceUpdated” that would have more info about the device’s state attached and would go directly out without being passed through the handler.
I think the switch to watching for “DeviceUpdated” was around the same time as an iOS version compatibility drop, so people with the old iOS had to hold on to the older version of the app. The way ZigBee devices were added then was they would first come through as unknown “Thing” devices, then the platform would request their simple description and when that came back they were given a type. The app was listening for the “updated” event to know that the device had its device type assigned, so if we stopped sending it, people on the older version would see everything join as “Thing”.
So the “updated” event was left in, and we kept having to check for it in parse(). As I mentioned in a recent post, it wasn’t originally possible to send commands from the updated() method, so for a few devices we decided to use that “updated” event to send commands on install or device type change. That was a bad idea since the event was basically deprecated, so we added a way to send from updated() instead, but not all of the code checking for “updated” was removed and was copied and pasted all over the place.
We’ve finally stopped sending the “updated” events, though looking at the code it may still be possible to get one in certain situations. It would make more sense to remove mention of it from all DTH code rather than document it, but we’re still at a point where if something isn’t causing problems it’s not a high priority. We’ve been short on bandwidth for testing DTH changes for a long time, and some of these handlers are used for dozens of products, so making even seemingly simple changes can be dangerous.