Giter Site home page Giter Site logo

nickborgers / isylib-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from evilpete/isylib-python

0.0 1.0 0.0 795 KB

Simple Python lib for the ISY home automation controller

License: BSD 2-Clause "Simplified" License

Python 99.49% Makefile 0.51%

isylib-python's Introduction

Branches

 public_dev : public commits
 dev : developer branch ( unstable )
 master : Main branch ( mostly stable )

ISYlib-python

by: Peter Shipley

Simple Python lib for the ISY home automation netapp Supporting a Simple and OO interface

The Goal / design concept is to provide a fast and simple to use interface supporting both object oriented and procedural methods

Also Supports real time cache updating by optionally running a sub-thread subscribing to event stream )

Note: This Lib has grown to the point it needs to be restructured / split up


This is a work in progress ( so expect new features )

see /bin for more examples

nodes, programs and iay vars can be controlled via objects or call methods.

Get and print the status for the node called "Garage Light"

import ISY
myisy = ISY.Isy(addr="admin", userp="admin, userl="isy")

garage_light = myisy.get_node("Garage Light")

print "Node {:} is {:}".format(garage_light.name, garage_light.formatted)

--

Get an object that represents the node called "Garage Light" and turn it off if it is on

import ISY
myisy = ISY.Isy()

garage_light = myisy.get_node("Garage Light")
if garage_light :
    garage_light.off()

--

Alternately you can obtain a Node's object by indexing a Isy obj my the node name or address

import ISY
myisy = ISY.Isy()
myisy["16 3F E5 1"].off()

or myisy["Garage Light"].off()

on 50% :

garage_light = myisy["Garage Light"]
garage_light.on(128)

or without node device objs

myisy.node_comm("Garage Light", "on", 128)

list all nodes and scenes and their status :

pfmt = "{:<22} {:>12}\t{:<12}{!s:<12}"
print(pfmt.format("Node Name", "Address", "Status", "Enabled"))
print(pfmt.format("---------", "-------", "------", "------"))
for nod in isy :
    if nod.objtype == "scene" :
        print(pfmt.format(nod.name, nod.address, "-", "-", ))
    else :
        print(pfmt.format(nod.name, nod.address, nod.formatted, nod.enabled, ))

--

Callbacks can be set up as easy as

def mycall(*args):
    print "mycall called: "
    for i in args :
        print "arg : ", type(i), i

myisy = ISY.Isy(addr="10.1.1.3", eventupdates=1)
myisy.callback_set("Garage Light", mycall, "my extra args")

or

garage_light = myisy["Garage Light"]
garage_light.set_callback(mycall, "my extra args")

or if your not passing extra arguments you can just :

garage_light = myisy["Garage Light"]
garage_light.set_callback = mycall

Callback will be call for all events relating to the node it is registared to

Callbacks are executed as a part of the event subthread

--

see also : http://www.universal-devices.com/residential/ and/or http://wiki.universal-devices.com/index.php?title=Main_Page

NOTE: This Libaray is not written by or supported by universal devices

ISYlib-python Documentation

[This needs to be updated]

  • Using_Isy_Class This is the main class that used to represent the ISY device iitself

  • Using_IsyNode_Class This class is used to represent and control individual Nodes ( aka: sensors and light switches )

  • Using_IsyVar_Class This class is used to represent varabibles internal to the ISY

[Analytics]

isylib-python's People

Contributors

copart avatar evilpete avatar joegross avatar nickborgers avatar sjthespian avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.