Help with Basic Plugin Structure

Posted on
Tue Aug 27, 2013 11:03 am
jd10884 offline
Posts: 39
Joined: Feb 18, 2012

Help with Basic Plugin Structure

Good day,

This basic plugin structure below works except for the method "def start(self)". Can you tell me what I am doing wrong?

Code: Select all
#! /usr/bin/env python
# -*- coding: utf-8 -*-

class Plugin(indigo.PluginBase):


   def __init__(self, pluginId, pluginDisplayName, pluginVersion, pluginPrefs):
      indigo.PluginBase.__init__(self, pluginId, pluginDisplayName, pluginVersion, pluginPrefs)

      self.debug = pluginPrefs.get("showDebugInfo", True)

   ########################################

   def __del__(self):
      indigo.PluginBase.__del__(self)

   ########################################

   def start(self):
        indigo.server.log(u"want to use this to create a text file")

    ########################################

   def runConcurrentThread(self):

      pInterval = 10

      self.debugLog("Starting concurrent thread")

      self.debugLog("L25 testing of basic structure is set to update every %s %s" %(pInterval, 'seconds'))

      try:
         while True:

            self.sleep(int(pInterval))
            self.update()

      except self.StopThread:
         pass

   ########################################

   def update(self):

      self.debugLog('L45 testing basic plugin structure')


Thanks in advance
Jeff

Posted on
Tue Aug 27, 2013 3:43 pm
Valdhor offline
Posts: 51
Joined: Mar 04, 2004
Location: North Carolina

Re: Help with Basic Plugin Structure

I can't imagine you want the superfluous "u" in the log statement.

Posted on
Tue Aug 27, 2013 4:03 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Help with Basic Plugin Structure

Use "startup" instead of "start".

The "u" in front of the text of the log statement tells Python that the following string of text should be Unicode compatible text (as opposed to the default ASCII). It won't hurt anything by having it there and will improve compatibility with international character sets on non-Western systems.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest