Ubiquiti Unifi Binding Feature Discussion

@mgbowman A couple things I wanted to mention for when you get a minute to look at this.

  • I originally thought I might be on an older version of the binding. But after looking at my environment, I think I’m running a pretty current version. Since the version I’m running uses Switch instead of Contact, it must’ve been built against a pretty current source tree.

  • In ControllerHandler, I see that cancelRefreshJob and scheduleRefreshJob are called in initialize, and that cancelRefreshJob is called in dispose. If in fact the framework is rapidly calling initialize-dispose-initialize (just a theory on my part), is there a potential to lose the reference to refreshJob? This possibly might explain why a refresh job continues to run even after the binding is stopped.

  • The problem doesn’t always occur at startup, which would argue in favor of a timing and/or race condition.

  • I’ve enabled debug logging with the logs going to a dedicated log file. Hopefully at some point, if this happens again, I’ll have more info on what’s actually happening.

Hope this helps.