502ebd2a311e1df2630527a22943f9dc8079a812,homeassistant/components/camera/foscam.py,FoscamCam,enable_motion_detection,#FoscamCam#,76

Before Change


    def enable_motion_detection(self):
        Enable motion detection in camera.
        ret, err = self._foscam_session.enable_motion_detection()
        if ret == FOSCAM_COMM_ERROR:
            _LOGGER.debug("Unable to communicate with Foscam Camera: %s", err)
            self._motion_status = True
        else:
            self._motion_status = False

    def disable_motion_detection(self):
        Disable motion detection.
        ret, err = self._foscam_session.disable_motion_detection()
        if ret == FOSCAM_COMM_ERROR:

After Change



    def enable_motion_detection(self):
        Enable motion detection in camera.
        try:
            ret = self._foscam_session.enable_motion_detection()
            self._motion_status = ret == FOSCAM_COMM_ERROR
        except TypeError:
            _LOGGER.debug("Communication problem")
            self._motion_status = False

    def disable_motion_detection(self):
        Disable motion detection.
        try:
            ret = self._foscam_session.disable_motion_detection()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: home-assistant/home-assistant
Commit Name: 502ebd2a311e1df2630527a22943f9dc8079a812
Time: 2018-01-25
Author: 6901273+i-am-shodan@users.noreply.github.com
File Name: homeassistant/components/camera/foscam.py
Class Name: FoscamCam
Method Name: enable_motion_detection


Project Name: catalyst-cooperative/pudl
Commit Name: fc44c71d4aa2e8a5ef60effd4bfe7fb82dffbf17
Time: 2021-01-06
Author: rousik@gmail.com
File Name: src/pudl/extract/excel.py
Class Name: GenericExtractor
Method Name: load_excel_file


Project Name: home-assistant/home-assistant
Commit Name: 502ebd2a311e1df2630527a22943f9dc8079a812
Time: 2018-01-25
Author: 6901273+i-am-shodan@users.noreply.github.com
File Name: homeassistant/components/camera/foscam.py
Class Name: FoscamCam
Method Name: disable_motion_detection