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

enable_motion_detection() when foscam is off causes error. Should exit gracefully with error code #17

Open
viswa-swami opened this issue Aug 1, 2017 · 0 comments

Comments

@viswa-swami
Copy link
Contributor

viswa-swami commented Aug 1, 2017

When foscam camera is off, and if we call 'enable_motion_detection()' then code returns an exception. code should gracefully handle it and return error code.

Below is error seen:

Send Foscam command: http://192.168.86.134:88/cgi-bin/CGIProxy.fcgi?usr=<username>&pwd=<password>&cmd=getMotionDetectConfig
Foscam exception: 
Traceback (most recent call last):
  File "./test.py", line 4, in <module>
    result = mycam.enable_motion_detection()
  File "/usr/local/lib/python3.5/dist-packages/foscam/foscam.py", line 626, in enable_motion_detection
    result = self.set_motion_detection(1)
  File "/usr/local/lib/python3.5/dist-packages/foscam/foscam.py", line 618, in set_motion_detection
    current_config['isEnable'] = enabled
TypeError: 'NoneType' object does not support item assignment

PR #16 fixes this issue.

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

1 participant