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:	182
Size:	259.6 KB
ID:	1559737

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

    Thanks
    Rob
    HS4Pro on a Raspberry Pi4
    54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
    Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

    HSTouch Clients: 1 Android

    #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 4.2.19.5
    Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
    Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
    Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

    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:	168
Size:	38.2 KB
ID:	1559832

          Comment

          Working...
          X