diff --git a/homeassistant/components/arlo.py b/homeassistant/components/arlo.py index 1ba2acb4fe0..0ab629cfbd4 100644 --- a/homeassistant/components/arlo.py +++ b/homeassistant/components/arlo.py @@ -12,7 +12,7 @@ from requests.exceptions import HTTPError, ConnectTimeout from homeassistant.helpers import config_validation as cv from homeassistant.const import CONF_USERNAME, CONF_PASSWORD -REQUIREMENTS = ['pyarlo==0.0.4'] +REQUIREMENTS = ['pyarlo==0.0.6'] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/camera/arlo.py b/homeassistant/components/camera/arlo.py index 80833e34b20..d473fa42d9d 100644 --- a/homeassistant/components/camera/arlo.py +++ b/homeassistant/components/camera/arlo.py @@ -14,15 +14,31 @@ from homeassistant.helpers.aiohttp_client import async_aiohttp_proxy_stream from homeassistant.components.arlo import DEFAULT_BRAND, DATA_ARLO from homeassistant.components.camera import Camera, PLATFORM_SCHEMA from homeassistant.components.ffmpeg import DATA_FFMPEG +from homeassistant.const import ATTR_BATTERY_LEVEL DEPENDENCIES = ['arlo', 'ffmpeg'] _LOGGER = logging.getLogger(__name__) +ATTR_BRIGHTNESS = 'brightness' +ATTR_FLIPPED = 'flipped' +ATTR_MIRRORED = 'mirrored' +ATTR_MOTION_SENSITIVITY = 'motion_detection_sensitivity' +ATTR_POWER_SAVE_MODE = 'power_save_mode' +ATTR_SIGNAL_STRENGTH = 'signal_strength' +ATTR_UNSEEN_VIDEOS = 'unseen_videos' + CONF_FFMPEG_ARGUMENTS = 'ffmpeg_arguments' + ARLO_MODE_ARMED = 'armed' ARLO_MODE_DISARMED = 'disarmed' +POWERSAVE_MODE_MAPPING = { + 1: 'best_battery_life', + 2: 'optimized', + 3: 'best_video' +} + PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Optional(CONF_FFMPEG_ARGUMENTS): cv.string, }) @@ -80,6 +96,28 @@ class ArloCam(Camera): """Return the name of this camera.""" return self._name + @property + def device_state_attributes(self): + """Return the state attributes.""" + return { + ATTR_BATTERY_LEVEL: + self._camera.get_battery_level, + ATTR_BRIGHTNESS: + self._camera.get_brightness, + ATTR_FLIPPED: + self._camera.get_flip_state, + ATTR_MIRRORED: + self._camera.get_mirror_state, + ATTR_MOTION_SENSITIVITY: + self._camera.get_motion_detection_sensitivity, + ATTR_POWER_SAVE_MODE: + POWERSAVE_MODE_MAPPING[self._camera.get_powersave_mode], + ATTR_SIGNAL_STRENGTH: + self._camera.get_signal_strength, + ATTR_UNSEEN_VIDEOS: + self._camera.unseen_videos + } + @property def model(self): """Camera model.""" diff --git a/requirements_all.txt b/requirements_all.txt index 4e82ee2a661..e6ea4b71f96 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -555,7 +555,7 @@ pyairvisual==1.0.0 pyalarmdotcom==0.3.0 # homeassistant.components.arlo -pyarlo==0.0.4 +pyarlo==0.0.6 # homeassistant.components.notify.xmpp pyasn1-modules==0.1.4