python-amcrest icon indicating copy to clipboard operation
python-amcrest copied to clipboard

Motion detected event should be filtered by channel id

Open akram opened this issue 6 years ago • 0 comments

The 6.9 GetEventIndexes section of the API documentation gives a way to know for which channel an event happened:

URL Syntax http://<ip>/cgi-bin/eventManager.cgi?action=getEventIndexes&code=<eventCode>

Comment | Get channels indexes that event of code eventCode happens. eventCode includes:VideoMotion: VideoLoss: VideoBlind: AlarmLocal:motion detection event video loss detection eventvideo blind detection event. alarm detection event.
-- | --
Response | channels[0]=0 channels[1]=2 channels[2]=3 ...(This response means event happened on channel 0, channel 2, and channel 3.)

Using this, we should be able to have a method telling if a motion detected event has occured for a given channel or not.

Currently, it seems that we only check that channels are present in the response, but we do not give access to the filtered information.

https://github.com/tchellomello/python-amcrest/blob/100344cec2b6ae9e112aae4bf5d49b7c3ee51c63/src/amcrest/event.py#L143

akram avatar Dec 25 '19 23:12 akram