Help deciphering an error in the log

I think I know what this error means but can someone confirm so I am not going down the wrong path?

I think this is telling me that the error was on line 796 of the driver code, and it was called from the "off" function. Which would make sense because it was when I told Alexa to turn the light off last night and it failed to turn off, but a second try and it did turn off so the cause of the error is a little confusing since it would have run the same code both times.


Here is how the variable is defined
@Field static Map<String, Map<Short, String>> supervisedPackets = [:]

Line 795 is supposed to initializing it to prevent this type of error I thought.

Line 795 did look like this (below) when the error happened, I changed to the brackets to see if it would make a difference. Seems to work fine either way when testing it.
if (!supervisedPackets."${}") { supervisedPackets."${}" = [:] }

I did borrow this code from an example @bcopeland posted for adding supervision to a driver and changed some of it a little but I think these parts are largely the same as his original code.

you must initialize supervisedPackets["${}"]


if (supervisedPackets["${}"] == null) supervisedPackets["${}"] = [:]

Isn't that what line 795 is doing already in my screenshot? Only difference is mine is using ! vs your example using == null. So maybe the error was some sort of a fluke. I think I have only seen it this one time.

I always prefer the more explicit == null to the groovyness of null might be false

Going to switch to that see if I get the error anymore. Also going to save the sessionID to a state because every time I update the driver it resets back to 1 and then the devices dont cooperate.

So this error popped back up again out of nowhere. Only thing I can think of is I just updated the driver code yesterday shortly before this happened. I know all the Field static variables get reset at that time. But I thought this check right above the error line should prevent it?

I have these two other lines which clear things out in certain cases not sure if that is mucking anything up but if it was I would expect to see the error more often.



This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.