Announcement

Collapse
No announcement yet.

Working with INI Files

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

    Working with INI Files

    It is my understanding that plugins typically store configuration settings in INI files that are located in the config subfolder. However, this folder is in the programs directory and windows is rather protective opening and modifying files in this path. So is there some special function from HomeSeer to write to those INI files?

    If it matters, I am creating a plugin that creates a virtual device whose triggers and actions are not known when the plugin is created. Hence I have to store those triggers and actions somewhere so that when the plugin is initialized I can recreate those triggers and actions.

    #2
    See here for the available functions: http://homeseer.com/support/homeseer...e_editing1.htm

    The file will be created automatically when you write to it if it doesn't already exist.

    Cheers
    Al
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    Comment


      #3
      Originally posted by mulu View Post
      It is my understanding that plugins typically store configuration settings in INI files that are located in the config subfolder. However, this folder is in the programs directory and windows is rather protective opening and modifying files in this path. So is there some special function from HomeSeer to write to those INI files?

      If it matters, I am creating a plugin that creates a virtual device whose triggers and actions are not known when the plugin is created. Hence I have to store those triggers and actions somewhere so that when the plugin is initialized I can recreate those triggers and actions.
      HS already offers the ability to store trigger/action data inside it's own database if you so wish, inside the strTrigActInfo you can store byte arrays of data - this is the guidance;

      ''' This is exclusively for plug-ins. Using a serialization procedure, the data for this plug-in
      ''' can be stored and managed within the HomeSeer database by the plug-in storing the serialized
      ''' object here. When HomeSeer is calling into the plug-in and wants to provide the trigger object
      ''' for the plug-in to analyze, it provides the serialized object data here in this byte array which
      ''' the plug-in can use to de-serialize back into an object that holds the trigger info. Since
      ''' parameters cannot be passed through the interface ByRef, this is read-only, but the plug-in is
      ''' allowed to RETURN a structure that includes Data or DataOut, which is a byte array, and contains
      ''' the serialized object after the plug-in updated it or made changes to it.

      Comment

      Working...
      X