diff --git a/homeassistant/components/abode/__init__.py b/homeassistant/components/abode/__init__.py index 85e05e89cc1..92665bc1890 100644 --- a/homeassistant/components/abode/__init__.py +++ b/homeassistant/components/abode/__init__.py @@ -261,6 +261,7 @@ def setup_abode_events(hass): TIMELINE.AUTOMATION_GROUP, TIMELINE.DISARM_GROUP, TIMELINE.ARM_GROUP, + TIMELINE.ARM_FAULT_GROUP, TIMELINE.TEST_GROUP, TIMELINE.CAPTURE_GROUP, TIMELINE.DEVICE_GROUP, diff --git a/homeassistant/components/abode/camera.py b/homeassistant/components/abode/camera.py index b7d5f1dbe4c..99d4fd433a7 100644 --- a/homeassistant/components/abode/camera.py +++ b/homeassistant/components/abode/camera.py @@ -82,8 +82,21 @@ class AbodeCamera(AbodeDevice, Camera): return None + def turn_on(self): + """Turn on camera.""" + self._device.privacy_mode(False) + + def turn_off(self): + """Turn off camera.""" + self._device.privacy_mode(True) + def _capture_callback(self, capture): """Update the image with the device then refresh device.""" self._device.update_image_location(capture) self.get_image() self.schedule_update_ha_state() + + @property + def is_on(self): + """Return true if on.""" + return self._device.is_on diff --git a/homeassistant/components/abode/manifest.json b/homeassistant/components/abode/manifest.json index d59ddd6217f..e9a871035e6 100644 --- a/homeassistant/components/abode/manifest.json +++ b/homeassistant/components/abode/manifest.json @@ -3,7 +3,7 @@ "name": "Abode", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/abode", - "requirements": ["abodepy==0.19.0"], + "requirements": ["abodepy==1.1.0"], "codeowners": ["@shred86"], "homekit": { "models": ["Abode", "Iota"] diff --git a/requirements_all.txt b/requirements_all.txt index 64ff88aff11..8259f8f4937 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -100,7 +100,7 @@ WazeRouteCalculator==0.12 YesssSMS==0.4.1 # homeassistant.components.abode -abodepy==0.19.0 +abodepy==1.1.0 # homeassistant.components.accuweather accuweather==0.0.9 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 880e1178640..351599ec1a3 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -43,7 +43,7 @@ WSDiscovery==2.0.0 YesssSMS==0.4.1 # homeassistant.components.abode -abodepy==0.19.0 +abodepy==1.1.0 # homeassistant.components.accuweather accuweather==0.0.9 diff --git a/tests/components/abode/test_camera.py b/tests/components/abode/test_camera.py index 0e843c59023..9db03d90222 100644 --- a/tests/components/abode/test_camera.py +++ b/tests/components/abode/test_camera.py @@ -38,3 +38,33 @@ async def test_capture_image(hass): ) await hass.async_block_till_done() mock_capture.assert_called_once() + + +async def test_camera_on(hass): + """Test the camera turn on service.""" + await setup_platform(hass, CAMERA_DOMAIN) + + with patch("abodepy.AbodeCamera.privacy_mode") as mock_capture: + await hass.services.async_call( + CAMERA_DOMAIN, + "turn_on", + {ATTR_ENTITY_ID: "camera.test_cam"}, + blocking=True, + ) + await hass.async_block_till_done() + mock_capture.assert_called_once_with(False) + + +async def test_camera_off(hass): + """Test the camera turn off service.""" + await setup_platform(hass, CAMERA_DOMAIN) + + with patch("abodepy.AbodeCamera.privacy_mode") as mock_capture: + await hass.services.async_call( + CAMERA_DOMAIN, + "turn_off", + {ATTR_ENTITY_ID: "camera.test_cam"}, + blocking=True, + ) + await hass.async_block_till_done() + mock_capture.assert_called_once_with(True)