Announcement

Collapse
No announcement yet.

ConvertLegacyData

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

    ConvertLegacyData

    How do you remove the legacy trigger(and actions) after calling ConvertLegacyData?

    I finally got ConvertLegacyData working to convert my legacy trigger to the new AbstractTriggerType - works great.
    How do you remove the old inData after it is converted so that it does not get re-converted over and over and over ?

    Click image for larger version

Name:	screenshot1.png
Views:	67
Size:	259.6 KB
ID:	1559737

    I feel like there should be something to remove that data after it is converted?

    Thanks
    Rob
    HS4Pro Running on a Raspberry Pi4
    72 Z-Wave Nodes, 111 Events, 422 Devices
    Z-Wave, UPB, WiFi
    Plugins: EasyTrigger, weatherXML, OMNI, Z-Wave, Tuya, Device History
    HSTouch Clients: 3 Android, 1 Joggler

    #2
    I use hs4.UpdatePlugTriggerallow and hs4.UpdatePlugAction to revise the trigger and action data so it no longer looks like a legacy trigger or event data

    i then check the datain.length < 500. hs3 datain is much shorter than hs4 datain. i guess this is a hack, but seems to work for my purposes.

    edit: i dont actually have code for the ConvertLegacyData method. i have my own that is one time use: MyConvertLegacyData
    Mark

    HS3 Pro 3.0.0.534
    Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway
    Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 (by Kirby) | Ultra1Wire3 | RFXCOM | NetCAM | MyQ | BLRadar | BLDenon | Jon00 Charting
    Platform: HP h8-1360t, Windows Server 2012 R2, i7-3.4GHz, 16GB memory

    Comment


      #3
      [deleted]

      Comment


        #4
        https://github.com/HomeSeer/Plugin-S...ment-595481935

        Looking at the Lifecycle of a Trigger you can see that the trigger is not saved to the HS database until after a call to OnConfigItemUpdate() returns true or a call to IsFullyConfigured() returns true. If you are just clicking the edit button on a trigger and not clicking the save button, the underlying TrigActData saved in the HS database will not be updated.

        Comment


          #5
          The UpdatePlugTrigger was added to IHsController

          Click image for larger version

Name:	Screenshot 2022-07-30 112606.png
Views:	41
Size:	38.2 KB
ID:	1559832

          Comment

          Working...
          X