If this is your first visit, be sure to check out the FAQ. You must register before you can post. Your first post will be checked for appropriate content
(SPAM) - please allow a bit of time for that. After that, you'll be able to post at will!
Announcement
Collapse
No announcement yet.
What is the equivalent for DeleteIODevices and SaveEventsDevices?
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
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?
Comment