Announcement

Collapse
No announcement yet.

What is the equivalent for DeleteIODevices and SaveEventsDevices?

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

    What is the equivalent for DeleteIODevices and SaveEventsDevices?

    Can't seem to find the equivalent for HS4. Perhaps SaveEventsDevices is not needed anymore but DeleteIODevices I use to clean up all devices with my PluginID, a very useful method.
    Thanks,
    Dirk

    #2
    Originally posted by dcorsus View Post
    Can't seem to find the equivalent for HS4. Perhaps SaveEventsDevices is not needed anymore but DeleteIODevices I use to clean up all devices with my PluginID, a very useful method.
    Thanks,
    Dirk
    We did determine that SaveEventDevices is unnecessary, and it has been deprecated. (its use has been rolled into other functionality which I can't speak precisely to right at this moment) There were numerous methods that we did not port over initially because there are either .NET Framework equivalents or because we wanted to determine if they were actually being used by plugins by waiting for someone to ask.

    I'll note DeleteIODevices and look into it. Another solution in the meantime would be to do the following:

    HSPI.cs
    Code:
    var deviceRefs = HomeSeerSystem.GetRefsByInterface(Name);
    foreach (var devRef in deviceRefs) {
        if (HomeSeerSystem.IsRefDevice(devRef)) {
            HomeSeerSystem.DeleteDevice(devRef);
            continue;
        }
    
        HomeSeerSystem.DeleteFeature(devRef);
    }
    I'll have to double check with you on whether or not the DeleteDevice method calls through its features to delete them too.

    So that we can better track these kinds of issues in the future, can I ask you to create issues for these things on the GitHub repo https://github.com/HomeSeer/Plugin-SDK?

    Thanks!

    Comment

    Working...
    X