Announcement

Collapse
No announcement yet.

Trigger ConvertLegacyData is being called too many times and never deserializes

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

  • rmasonjr
    replied
    interesting - going to work on that this afternoon. Thanks!

    Leave a comment:


  • alexbk66
    replied
    Yep

    Leave a comment:


  • rmasonjr
    replied
    Originally posted by alexbk66 View Post
    Do you actually include PluginSdk source? Big help
    No, I'm not. Do you including it as a project within your solution?

    Leave a comment:


  • alexbk66
    replied
    Do you actually include PluginSdk source? Big help

    Leave a comment:


  • rmasonjr
    replied
    Originally posted by alexbk66 View Post
    I usually include PluginSDK source code (not the built dll) in my solutions - so you can debug these issues.

    If you check AbstractTriggerType.cs source - ConvertLegacyData() is called from ProcessData() which is called from InflateTriggerFromData() which is called from every trigger constructor, which is called four times when trigger config is loaded.

    This was supposed to be fixed in one of recent PluginSdk releases.

    And if you look at the ProcessData() below - ConvertLegacyData() is called when de-serialising "inData" throws an exception.

    There are already four closed issues in GitHub about this https://github.com/HomeSeer/Plugin-S...vertLegacyData

    Click image for larger version  Name:	Screenshot 2022-07-22 214746.png Views:	0 Size:	30.6 KB ID:	1558591
    Thanks Alex. I've hit breakpoints on ConvertLegacyData, but my legacy trigger class is never getting deserialized.

    Also, ConvertLegacyData never gets called at all on my AbstractActionType class. I havent opened a ticket on that one yet.

    I do keep that page and others on the SDK open during development to try and figure some of this stuff out. Their latest sample plugin includes some stuff, but their trigger example is really hard to understand.

    Thank goodness for breakpoints and debug. This is one big easter egg hunt.
    Last edited by rmasonjr; July 22, 2022, 08:13 AM. Reason: spelling

    Leave a comment:


  • alexbk66
    replied
    https://docs.homeseer.com/display/HS...acy+Event+Data

    Leave a comment:


  • alexbk66
    replied
    I usually include PluginSDK source code (not the built dll) in my solutions - so you can debug these issues.

    If you check AbstractTriggerType.cs source - ConvertLegacyData() is called from ProcessData() which is called from InflateTriggerFromData() which is called from every trigger constructor, which is called four times when trigger config is loaded.

    This was supposed to be fixed in one of recent PluginSdk releases.

    And if you look at the ProcessData() below - ConvertLegacyData() is called when de-serialising "inData" throws an exception.

    There are already four closed issues in GitHub about this https://github.com/HomeSeer/Plugin-S...vertLegacyData

    Click image for larger version

Name:	Screenshot 2022-07-22 214746.png
Views:	51
Size:	30.6 KB
ID:	1558591

    Leave a comment:


  • Trigger ConvertLegacyData is being called too many times and never deserializes

    I opened an issue on github, but thought I would ask here too...

    When I launch the Events page in HomeSeer, my plugin code, specficially, ConvertLegacyData is called numerous times.
    This is just when I open the Events page, without editing an event.

    Also, it never deserializes my old legacy trigger - it's always Nothing with no exceptions being thrown.

    What would be the reasoning of HS calling (every) plugin's AbstractTriggerType methods?
    I guess I am expecting it to only be called when the specific event is being edited, so I can convert it to the new trigger type.


    Click image for larger version

Name:	screenshot1.png
Views:	57
Size:	255.0 KB
ID:	1558445

    Any thoughts on why this behavior?

    HS4 v4.2.14.0
    PluginSDK 1.4.2

Working...
X