Coder Social home page Coder Social logo

isylib-python's People

Contributors

copart avatar evilpete avatar joegross avatar sjthespian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

isylib-python's Issues

crash from bad code

_isynode.py line 580 in master branch.
Must enclose the format parameters in parenthesis to form a tuple as such:

raise IsyResponseError(
"Node Cmd/Property Set error : node=%s prop=%s " %
(naddr, prop) )

Inconsistent formatted values

masterLight = myisy.get_node("Master Bedroom - Main")
print "Node {:} is {:}".format(masterLight.name, masterLight.formatted)

results in a formatted value of "on" or "off"

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

results in a formatted value of "100%" or "off"

Line 88 of _isynode.py should check if the value is dimable. If it is not dimable, it should return "on" instead of "100%".

Error in return from var_get_value. Keyerror

In var_get_value it appears that there is an error returning the value:

This:
if varid in self._vardict :
return(self._vardict[prop])

Should be:
if varid in self._vardict :
return(self._verdict[varid][prop])

Subscribing to Event Updates causes Authentication Error

When trying to subscribe to the event updates, I get a 401 error. It seems that on line 459 of IsyEvent.py, admin is hard coded as the username and password. I fixed this on my end, but I'm still getting another problem that I'm looking into.

Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 808, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 761, in run
self.__target(_self.__args, *_self.__kwargs)
File "ISY\IsyEvent.py", line 331, in events_loop
self.process_func(d, self.process_func_arg, x)
File "ISY\IsyClass.py", line 330, in _read_event
if evnt_dat["node"] in self._nodedict :
TypeError: argument of type 'NoneType' is not iterable

Unable to install

Hey, Pete.

I've cloned your code and run 'sudo python setup.py --dry-run --verbose install'.

All appears to go well until it hits this point:

...
changing mode of build/scripts-2.7/isy_nodes.py
changing mode of build/scripts-2.7/isy_var.py
zip_safe flag not set; analyzing archive contents...
error: [Errno 2] No such file or directory: 'build/bdist.linux-armv7l/egg/EGG-INFO/zip-safe'

I've attempted to locate the 'build' directory and create the necessary path but no luck so far.

Is there something I'm missing?

Thanks,
dp

Thermostat Temperature not updating.

This is awesome code. REALLY helpful. Thank you. I have noticed that in my event callback, the current temperature reading of my thermostats never update. The other attributes do. Any insight into something I can do? For example, this thermostat reading always says 56 degrees:

"ST": {
"formatted": "56",
"id": "ST",
"uom": "degrees",
"value": "143"
}

If I do a curl call to the REST api, I get the correct temperature in the XML that is returned.

Thanks,
David

Package setup issue.

While trying to install your library setup failed. I traced the issue to two errors in the setup.py file:

  1. bin/isy_prog.py should be bin/isy_progs.py
  2. binisy_nestset.py should be bin/isy_nestset.py

Now I need to go pick up a Nest.

Update releases to PyPi

It looks like this isn't released very often?
https://pypi.python.org/pypi/ISYlib

I'm going to rewrite my ISY Hue Emulator interface I use for integrating with a Harmony Hub, and was thinking to move from PyISY to ISYlib-python, but would prefer to have a released version.

TypeError: 'NoneType' object is not iterable

Hello,

Anxious to put this to work! I'm have a basic problem however. See my simple script below and the error.

Thanks for your help!
Bob

My minimal script:
import ISY
myisy = ISY.Isy()
myisy.node_comm("Mantle LEDs", "on")

Result:
pi@raspberrypi ~/myNas/RasPi/python $ python isypy_test.py
('naddr : ', 'Mantle LEDs', ' : ', '28 20 6D 1')

Traceback (most recent call last):
File "isypy_test.py", line 4, in
myisy.node_comm("Mantle LEDs", "on")
File "/usr/local/lib/python2.7/dist-packages/ISYlib-0.1.20140704-py2.7.egg/ISY/_isynode.py", line 631, in node_comm
self._updatenode(naddr)
File "/usr/local/lib/python2.7/dist-packages/ISYlib-0.1.20140704-py2.7.egg/ISY/_isynode.py", line 791, in _updatenode
for child in list(_nodestat) :
TypeError: 'NoneType' object is not iterable

KeyError: 'r'

I've seen this error twice now? Not sure what triggers it.

Exception in thread event_looper: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 505, in run self.__target(*self.__args, **self.__kwargs) File "/usr/local/lib/python2.7/dist-packages/ISY/IsyEvent.py", line 594, in events_loop self.process_func(d, self.process_func_arg, x) File "/usr/local/lib/python2.7/dist-packages/ISY/IsyClass.py", line 501, in _read_event prog_dict['lastRunTime'] = evnt_dat['eventInfo']['r'] KeyError: 'r'

My program is simply checking an ISY var:
driveway_flag = myisy.get_var("Driveway_Flag")

PEP8 Standards and Cleanup

May I suggest that the code in this library gets some much needed cleanup towards PEP8 standards? Might be time to put a Travis CI hook on the project and force flake8 validation on the entire code base.

Just tried merging the latest changes, but some of the latest commits actually introduced new PEP8 violations.

node/structure/variable realtime cache

Hi,

figured I switch the discussion from the ISY forum (subscription structures thread) over here. BTW Thank you for your responses and the work you are doing here.

Question: Have you thought about adding a state cache for all nodes/structures/variables of the ISY to this class?

You could poll the ISY on startup (optional) and store the information of all accessible information in a python structure. Even on large systems thats only hundreds of items.

Then with a subscription the class could keep the information in sync with the ISY controller.

It would open up a whole new world of possibilities to take the ISY into new use cases that are very hard or complicated today.

Even some of the event processing could be done in python rather than the very limited event language of the ISY.

Error Message with eventupdates

Let me start with saying I am nowhere near a python expert and this may be user error:

My Code:
import ISY

myisy = ISY.Isy(addr="192.168.13.130",userl="admin",userp="admin",debug=0,eventupdates=1)

light = myisy.get_node("Kitchen Lights")

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

light.on()

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

When I run this code with eventupdates=1 i receive the following run time errors:
Traceback (most recent call last):
File "C:\Python27\ISYlib\Pat.py", line 3, in
myisy = ISY.Isy(addr="192.168.13.130",userl="admin",userp="admin",debug=0,eventupdates=1)
File "C:\Python27\ISYlib\ISY\IsyClass.py", line 303, in init
self.start_event_thread()
File "C:\Python27\ISYlib\ISY\IsyClass.py", line 378, in start_event_thread
self._preload(rload=0)
File "C:\Python27\ISYlib\ISY\IsyClass.py", line 1393, in _preload
self.load_vars()
File "C:\Python27\ISYlib\ISY_isyvar.py", line 54, in load_vars
for v in vinfo.iter("e") :
AttributeError: 'NoneType' object has no attribute 'iter'

When I set eventupdates=0 the code executes properly however, on the second print statement the status of the light is not updated. I assume this is where the eventupdates variable becomes relevant.

Running Python 2.7.6 on Win 2K8 R2 X64

variable reads don't update

I've been working with the library and so far everything seems great, but one problem I've found is that variable values don't update.

I have my code set like this:

while True:
    isy_VARIABLE_NAME = isy.get_var("VARIABLE_NAME")
    value = isy_VARIABLE_NAME.get_var_value()
    logger.debug("The current value of WD_EventGhost: {}".format(value))
    time.sleep(60)

The first time the look runs it's perfect, it grabs the value of the variable named "VARIABLE_NAME", but then after I update the value on the ISY, it never updates what python sees. Also as if it's only reaching out the ISY once.

However, if I use:

counter = 0
while True:
    isy_VARIABLE_NAME.value = counter
    counter = counter + 1
    time.sleep(60)

it updates the variable without problems

Any ideas?

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.