ISY Developers:API:Python

From Universal Devices, Inc. Wiki
Jump to: navigation, search

Python API

Place Holder for Python API

The Python API is a wrapper to the Rest & Soap API


Getting the Python API

The Source is available on | Github

or you can use the command :

  git clone https://github.com/evilpete/ISYlib-python.git


Classes

class Isy

batch(self, on=-1)

Batch mode

batterypoweredwrites(self, on=-1)

Battery Powered Writes

call_soap(self, cmd, **kwargs)

wrapper funtion for making SOAP API calls

callback_del(self, nid)

delete a callback funtion

callback_get(self, nid)

get a callback funtion for a Nodes

callback_set(self, nid, func, *args)

set a callback function for a Node

clim_get_val(self, prop)

returns named climate valuse

clim_iter(self)

Iterate though climate values

clim_query(self)

returns dictionary of climate info

electricity(self)

electricity status

folder_add_node(self, nid, nodeType=1, parent=, parentType=3)

move node/scene from folder

folder_del(self, fid)

delete folder

folder_del_node(self, nid, nodeType=1)

remove node from folder

folder_new(self, fid, fname)

create new Folder

folder_rename(self, fid, fname)

rename Folder


get_node(self, node_id)

Get a Node object for given node or scene name or ID


get_prog(self, pname)

get prog class obj

get_var(self, vname)

get var class obj


load_clim(self)

Load climate data from ISY device


load_conf(self)

Load configuration of the system with permissible commands


load_log_id(self)

load log id tables


load_log_type(self)

load log type tables

load_net_resource(self)

Load node WOL and Net Resource config infomation


load_net_wol(self)

Load Wake On LAN networking resources


load_node_types(self)

Load node type info into a multi dimentional dictionary


load_nodes(self)

Load node list scene list and folder info


load_prog(self)

Load Program status and Info


load_vars(self)

Load variable names and values

log_format_line(self, line)

format a ISY log line into a more human readable form

log_iter(self, error=0)

iterate though log lines

log_query(self, errorlog=0, resetlog=0)

get log from ISY

log_reset(self, errorlog=0)

clear log lines in ISY


net_resource_iter(self)

iterate net_resource data

net_resource_names(self)

method to retrieve a list of networking resource names

net_resource_run(self, rrid)

Calls and executes net resource

net_wol(self, wid)

Send Wake On LAN to registared wol ID

net_wol_iter(self)

Iterate though Wol Ids values

net_wol_names(self)

method to retrieve a list of WOL names

network(self)

network configuration

node_addrs(self)

access method for node addresses
returns a iist scene/group addresses

node_comm(self, naddr, cmd, *args)

Send node command

node_get_prop(self, naddr, prop_id)

Get node property

node_get_type(self, typid)

Take a node's type value and returns a string idnentifying the device

node_iter(self, nodetype=)

Iterate though nodes


node_names(self)

access method for node names
returns a dict of ( Node names : Node address )

node_rename(self, nid, nname)

rename Node


node_set_prop(self, naddr, prop, val)

Set node property

prog_comm(self, paddr, cmd)

Send program command

prog_iter(self)

Iterate though program objects

reboot(self)

Reboot ISY Device
args: none

scene_add_node(self, groupid, nid, nflag=16)

add node to Scene/Group

scene_addrs(self)

access method for scene addresses
returns a iist scene/group addresses

scene_del(self, sid=None)

delete Scene/Group

scene_del_node(self, groupid, nid)

Remove Node from Scene/Group


scene_names(self)

access method for scene names
returns a dict of ( Node names : Node address )

scene_new(self, nid=0, sname=None)

new Scene/Group

scene_rename(self, fid, fname)

rename Scene/Group


start_event_thread(self, mask=0)

starts event stream update thread

stop_event_tread(self)

Stop update thread

subscriptions(self)

get event subscriptions list and states


sys(self)

system configuration

time(self)

system time of ISY

var_addrs(self)

access method for var addresses

var_get_type(self, var)

Takes Var name or ID and returns type


var_get_value(self, var, prop='val')

Get var value by name or ID

var_iter(self, vartype=0)

Iterate though vars objects

var_set_value(self, var, val, prop='val')

Set var value by name or ID

x10_comm(self, unit, cmd)

direct send x10 command

Nodes Objects

Devices controlled my the ISY are represented at "nodes" on the ISY device and with Node Objects in the API

There are three types of Node Object:

  • IsyNode - Node Object
Represent lights, switches, motion sensors
  • IsyScene - Scene Object
Represents Scenes contains Nodes that comprise a "Scene"
  • IsyNodeFolder - Can hold Scene's or Nodes
a organizational obj for Scene's and Nodes


Only IsyNode Objects maintain "state"

class IsyNode

Data descriptors

enable

enable/disable a node

onlevel

Get/Set On Level property of Node

ramprate

Get/Set RampRate property of Node

status

Get/Set Status property of Node

address

Address or ID of Node (readonly)

name

Name of Node (readonly)

Methods

beep(self)

is_dimable(self)

is_member(self, obj)

member_add(self, node, flag=0)

member_iter(self, flag=0)

iter though sub nodes

member_list(self)

members_list(self)

nodeType(self)

off(self)

Send Off command to a node

on(self, val=255)

Send On command to a node
take optional value for on level

class IsyScene

is_member(self, obj)

member_add(self, node, flag=16)

member_del(self, node)

member_iter(self, flag=0)

iter though members nodes


member_list(self)

rename(self, newname)

rename node/scene/folder


class IsyNodeFolder

Methods

member_add(self, node, flag=0)

add Node/Scene or Folder to Folder Obj

member_del(self, node)

del Node/Scene or Folder to Folder Obj

member_iter(self, flag=0)

iter though members
Folders iter though their contents (nodes/scenes/folders)
renames current Obj Folder


class IsyProgram

class IsyVar

Object attributes/properties :

     ts :        timetamp
     type :      Var Type
     init :      inital value for Var ( at ISY boot )
     value :     current value
     id :        unique for Var used by ISY
     name :      name of var

funtions

     get_var_init() :    get  inital value for Var
     set_var_init(new_value) :   set inital value for Var
     get_var_value() :   get current value
     set_var_value(new_value) :  set new value for Var


class SendSoapCmd

class ISYEvent