Announcement

Collapse
No announcement yet.

RegisterEventCB and an Event with Dual Actions and a Delay

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    RegisterEventCB and an Event with Dual Actions and a Delay

    Short:
    • The call to RegisterEventCB appears to cause an Event with Dual-Actions and a Delay to log "Object reference not set to an instance of an object" errors
    While testing the awesome ScreenLogic plugin, strange "Object reference not set to an instance of an object" (no, I mean stranger than usual) errors appeared in the Log. The errors occur when an Event with Dual-Actions and a Delay was run. To eliminate my plugin, I changed the Event to use a virtual device. Same thing. The reference Ids were either very low or very high, but none associated with the Plugin. Screenshot below .. I added the "DeviceManager" line so I could see what events were received which were not referencing Features associated with my plugin.

    Restart HS without my plugin .. no errors .. start my plugin and the errors are back. Step through the plugin and after RegisterEventCB is called, the Event starts logging errors. I use RegisterEventCB to be informed when the Plugin's Features are renamed and it seems to work fine.

    Why is RegisterEventCB causing Events to log errors? Has anyone else seen this? The Event appears to execute correctly

    Click image for larger version  Name:	HSEvents.jpg Views:	0 Size:	51.7 KB ID:	1562427
    Click image for larger version  Name:	DualAction Event.png Views:	0 Size:	84.8 KB ID:	1562429
    Attached Files

    #2
    Log a request https://github.com/HomeSeer/Plugin-SDK/issues

    Comment


      #3
      FYI - the bug was in my code {blush} when handing the HSEvent callback. I had been testing for the Event type (CONFIG_CHANGE) however, there are additional parameters which indicate the target of the Event, and in this case I needed to ensure if was a Device Config Change .. ConfigChange parameter Home (EConfigChangeTarget)

      HSEvent

      Comment

      Working...
      X