- indigo.server.log('Received action: \n%s\n' % (action))
- delayAmount : 900
description : plugin action
deviceId : 145579207
pluginId : com.berkinet.apcupsd
pluginTypeId : apcupsdServerEvent
props : com.berkinet.apcupsd : (dict)
- actionType : commok (string)
textToSpeak :
Now, I have added a class to create my own action object with just the fields I need for my method. The method processes the object just fine. But, when I attempt to log the object, I get
- <__main__.Action object at 0xfd1c710>
I was just wondering why Indigo's object can be interpreted by a %s and mine can't?
For reference, here is the class that creates the object:
- Code: Select all
class Action(object):
def __init__(self):
self.deviceId = 1
self.actionType = None
self.pluginTypeId = 'apcupsdServerEvent'
self.props = {'actionType': 'commok'}
And here is where I actually create my object:
- Code: Select all
action = Action()
action.deviceId = 145579207
action.pluginTypeId = 'apcupsdServerEvent'
action.props['actionType'] = event
action.pluginTypeId = 'apcupsdServerEvent'