Skip to content

Commit

Permalink
Merge pull request #124 from twrecked/thumbnail_url
Browse files Browse the repository at this point in the history
Thumbnail url
  • Loading branch information
twrecked authored Oct 16, 2019
2 parents 23e35d3 + 4de396b commit 62b4ed7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
aarlo/pyaarlo
0.6.1: added last thumbnail url
0.6.0: New revision

aarlo:
Expand Down
4 changes: 2 additions & 2 deletions custom_components.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"aarlo": {
"version": "0.6.0",
"version": "0.6.1",
"local_location": "/custom_components/aarlo/__init__.py",
"remote_location": "https://raw.githubusercontent.com/twrecked/hass-aarlo/master/custom_components/aarlo/__init__.py",
"visit_repo": "https://github.com/twrecked/hass-aarlo",
Expand All @@ -17,7 +17,7 @@
]
},
"pyaarlo": {
"version": "0.6.0",
"version": "0.6.1",
"local_location": "/custom_components/aarlo/pyaarlo/__init__.py",
"remote_location": "https://raw.githubusercontent.com/twrecked/hass-aarlo/master/custom_components/aarlo/pyaarlo/__init__.py",
"visit_repo": "https://github.com/twrecked/hass-aarlo",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/aarlo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
CONF_USERNAME, CONF_PASSWORD, CONF_SCAN_INTERVAL, CONF_HOST)
from homeassistant.helpers import config_validation as cv

__version__ = '0.6.0'
__version__ = '0.6.1'

_LOGGER = logging.getLogger(__name__)

Expand Down
7 changes: 7 additions & 0 deletions custom_components/aarlo/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
ATTR_WIRED_ONLY = 'wired_only'
ATTR_LAST_VIDEO = 'last_video'
ATTR_VOLUME = 'volume'
ATTR_LAST_THUMBNAIL = 'last_thumbnail'
ATTR_DURATION = 'duration'

CONF_FFMPEG_ARGUMENTS = 'ffmpeg_arguments'
Expand Down Expand Up @@ -333,6 +334,7 @@ def device_state_attributes(self):
(ATTR_CHARGER_TYPE, self._camera.charger_type),
(ATTR_WIRED, self._camera.wired),
(ATTR_WIRED_ONLY, self._camera.wired_only),
(ATTR_LAST_THUMBNAIL, self.last_thumbnail_url),
(ATTR_LAST_VIDEO, self.last_video_url),
) if value is not None
}
Expand Down Expand Up @@ -366,6 +368,11 @@ def motion_detection_enabled(self):
def last_video(self):
return self._camera.last_video

@property
def last_thumbnail_url(self):
video = self._camera.last_video
return video.thumbnail_url if video is not None else None

@property
def last_video_url(self):
video = self._camera.last_video
Expand Down
2 changes: 1 addition & 1 deletion custom_components/aarlo/pyaarlo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
logging.basicConfig(level=logging.DEBUG)
_LOGGER = logging.getLogger('pyaarlo')

__version__ = '0.6.0'
__version__ = '0.6.1'


class PyArlo(object):
Expand Down

0 comments on commit 62b4ed7

Please sign in to comment.