Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid syntax #21

Closed
nor500 opened this issue Mar 9, 2018 · 3 comments
Closed

invalid syntax #21

nor500 opened this issue Mar 9, 2018 · 3 comments

Comments

@nor500
Copy link

nor500 commented Mar 9, 2018

I am really interested in your project. I replaced my credentials in the example but python3 gave an error message: SyntaxError: invalid syntax
:
import pyhik.hikvision

camera = pyhik.hikvision.HikCamera('http://X.X.X.X', port=80, user='admin', pass='1234')

What shall I do?

@ghost
Copy link

ghost commented Mar 16, 2018

@nor500 I have the same problem. Probably because of the word pass

@mezz64
Copy link
Owner

mezz64 commented Mar 16, 2018

Take a look at the Home Assistant implementation (https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/binary_sensor/hikvision.py) if you want a full featured example. The example in the readme is a bit out of date. The actual init parameters are now:

def __init__(self, host=None, port=DEFAULT_PORT,usr=None, pwd=None)

@ghost
Copy link

ghost commented Mar 16, 2018

@mezz64
Thank you, now it works.

import pyhik.hikvision
camera = pyhik.hikvision.HikCamera('http://192.168.X.X', port=80, usr='admin', pwd='admin')
print camera

<pyhik.hikvision.HikCamera object at 0x7ff3a8ea0850>

Home-assistant, this is a cool project, but for me it's difficult, although I managed to run it.
2018-03-16 23-21-20

How can I get easy access to the motion detection status using pyhik, for use in my project?

@mezz64 mezz64 closed this as completed Dec 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants