Giter Site home page Giter Site logo

hikvision's Introduction

hikvision's People

Contributors

fabaff avatar fbradyirl avatar gjbadros avatar wikkibe 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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hikvision's Issues

Filenames

The example script imports hikvision.py - the file in the repo is named api.py .
I changed the example thus:
`import api

hik_camera = api.CreateDevice(...` and so on.

The script api.py imports hikvision.error - the error file is named error.py , and likewise hikvision.constants is named constants.py . I changed api.py thus:
from error import... and so on,
from constants import... and so on (once for each of the two references).

Of course, renaming the files is probably the more sensible way!

Can not find the CGI API Guide anymore

Hello, I want to develop the function of snapshot for hikvision in python, but I can not find CGI API Guide from the URL resource you give from the README. Is there a backup or something?

gnerate qr

How to generate qr for other devices?

NVR VideoDownload

Hello @fbradyirl

I have been trying to grasp some good code for hikvision NVR's (which have only IP Cameras) to do "video download". Is there any way your code can do this?

Thank for your replies.

API Documentation Link

  • hikvision package version: NULL
  • Python version: NULL
  • Operating System: Win 10

Description

Hey Just looking for the API documentation that the README links to is no longer a valid link.

Would you be able to link to the API Documentation that your using or even include it in the repo.

Appreciate the help.

The project looks great. Cant wait to start using it.

Cannot disable motion detection

I filed a bug in the Home Assistant repo. However, looks like the problem is related to the underlying library. I am unable to disable motion using the library. See the trace below:

>>> hik_camera.is_motion_detection_enabled()
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.2.91
DEBUG:urllib3.connectionpool:http://192.168.2.91:80 "GET /MotionDetection/1 HTTP/1.1" 200 406
DEBUG:hikvision.api:Response: <?xml version="1.0" encoding="UTF-8"?>
<MotionDetection version="1.0" xmlns="http://www.hikvision.com/ver10/XMLSchema">
<id>1</id>
<enabled>true</enabled>
<regionType>grid</regionType>
<Grid>
<rowGranularity>15</rowGranularity>
<columnGranularity>22</columnGranularity>
</Grid>
<MotionDetectionRegionList>
<sensitivityLevel>1</sensitivityLevel>
</MotionDetectionRegionList>
</MotionDetection>

INFO:hikvision.api:Current motion detection state? enabled: true
True
>>> hik_camera.disable_motion_detection()
DEBUG:hikvision.api:xml:
DEBUG:hikvision.api:b'<MotionDetection xmlns="http://www.hikvision.com/ver10/XMLSchema" version="1.0">\n<id>1</id>\n<enabled>false</enabled>\n<regionType>grid</regionType>\n<Grid>\n<rowGranularity>15</rowGranularity>\n<columnGranularity>22</columnGranularity>\n</Grid>\n<MotionDetectionRegionList>\n<sensitivityLevel>1</sensitivityLevel>\n</MotionDetectionRegionList>\n</MotionDetection>'
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/requests/utils.py", line 868, in check_header_validity
    if not pat.match(value):
TypeError: expected string or bytes-like object

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/srv/homeassistant/lib/python3.6/site-packages/hikvision/api.py", line 235, in disable_motion_detection
    self.put_motion_detection_xml(self.xml_motion_detection_off)
  File "/srv/homeassistant/lib/python3.6/site-packages/hikvision/api.py", line 247, in put_motion_detection_xml
    self._username, self._password), data=xml, headers=headers)
  File "/srv/homeassistant/lib/python3.6/site-packages/requests/api.py", line 126, in put
    return request('put', url, data=data, **kwargs)
  File "/srv/homeassistant/lib/python3.6/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/srv/homeassistant/lib/python3.6/site-packages/requests/sessions.py", line 494, in request
    prep = self.prepare_request(req)
  File "/srv/homeassistant/lib/python3.6/site-packages/requests/sessions.py", line 437, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/srv/homeassistant/lib/python3.6/site-packages/requests/models.py", line 306, in prepare
    self.prepare_headers(headers)
  File "/srv/homeassistant/lib/python3.6/site-packages/requests/models.py", line 440, in prepare_headers
    check_header_validity(header)
  File "/srv/homeassistant/lib/python3.6/site-packages/requests/utils.py", line 872, in check_header_validity
    "bytes, not %s" % (name, value, type(value)))
requests.exceptions.InvalidHeader: Value for header {Content-Length: 354} must be of type str or bytes, not <class 'int'>
>>> 

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.