Skip to content

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

@viswa-swami

Description

@viswa-swami

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions