cybermaggedon / pyvera

Python Vera interaction
GNU General Public License v3.0
3 stars 4 forks source link

How do you install? #9

Open scaldara55 opened 5 years ago

scaldara55 commented 5 years ago

Newbie question. I like what I see in your repository for interacting with Vera. I do not know how to install the module. I don't see a setup.py for installation. If I pip install vera it doesn't recognize the method to connect to the controller. If I pip install pyvera I get a different repository.

scaldara55 commented 5 years ago

I figured it out. Clone the repository and run it locally.

cybermaggedon commented 3 years ago

I added packaging, so something like this should work...

pip3 install --user git+https://github.com/cybermaggedon/pyvera
scaldara55 commented 3 years ago

I used your pip3 install command. I'm running Python 3.9.1. The import works fine. When I try to create the local object I get an error.

ve = vera.VeraLocal("192.168.1.127") Traceback (most recent call last): File "", line 1, in File "/Users/steve/.virtualenvs/py3.9.1cv/lib/python3.9/site-packages/vera/vera.py", line 1909, in init Vera.init(self) File "/Users/steve/.virtualenvs/py3.9.1cv/lib/python3.9/site-packages/vera/vera.py", line 1509, in init self.update_state() File "/Users/steve/.virtualenvs/py3.9.1cv/lib/python3.9/site-packages/vera/vera.py", line 1582, in update_state s.definition = SceneDefinition.parse(self, i) File "/Users/steve/.virtualenvs/py3.9.1cv/lib/python3.9/site-packages/vera/vera.py", line 1145, in parse for i in s["triggers"]: KeyError: 'triggers'

I took a look at the code and the only thing I saw was that you use 'triggers' both as a name of a list as well as a key in a dictionary. Could this cause the problem?

scaldara55 commented 3 years ago

See comment above

cybermaggedon commented 3 years ago

@scaldara55 Looks like the 'triggers' object is optional, and i should have been checking for it before using. I've pushed a commit, maybe that works?