Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream support for Doorbird component #22876

Merged
merged 8 commits into from Apr 8, 2019
@@ -11,7 +11,7 @@
import homeassistant.helpers.config_validation as cv
from homeassistant.util import dt as dt_util, slugify

REQUIREMENTS = ['doorbirdpy==2.0.6']
REQUIREMENTS = ['doorbirdpy==2.0.8']

_LOGGER = logging.getLogger(__name__)

@@ -6,7 +6,7 @@
import aiohttp
import async_timeout

from homeassistant.components.camera import Camera
from homeassistant.components.camera import Camera, SUPPORT_STREAM
from homeassistant.helpers.aiohttp_client import async_get_clientsession

from . import DOMAIN as DOORBIRD_DOMAIN
@@ -31,8 +31,10 @@
async_add_entities([
DoorBirdCamera(
device.live_image_url,
device.rtsp_live_video_url,

This comment has been minimized.

Copy link
@hunterjm

hunterjm Apr 8, 2019

Contributor

Looks like this is in the wrong place. Will set name to stream.

_CAMERA_LIVE.format(doorstation.name),
_LIVE_INTERVAL),
_LIVE_INTERVAL,
stream_url=device.rtsp_live_video_url),

This comment has been minimized.

Copy link
@hunterjm

hunterjm Apr 8, 2019

Contributor

Once above is fixed, can remove stream_url=

DoorBirdCamera(
device.history_image_url(1, 'doorbell'),
_CAMERA_LAST_VISITOR.format(doorstation.name),
@@ -47,15 +49,27 @@
class DoorBirdCamera(Camera):
"""The camera on a DoorBird device."""

def __init__(self, url, name, interval=None):
def __init__(self, url, name, interval=None, stream_url=None):
"""Initialize the camera on a DoorBird device."""
self._url = url
self._stream_url = stream_url
self._name = name
self._last_image = None
self._supported_features = SUPPORT_STREAM if self._stream_url else 0
self._interval = interval or datetime.timedelta
self._last_update = datetime.datetime.min
super().__init__()

@property
def stream_source(self):
"""Return the stream source."""
return self._stream_url

@property
def supported_features(self):
"""Return supported features."""
return self._supported_features

@property
def name(self):
"""Get the name of the camera."""
@@ -3,7 +3,7 @@
"name": "Doorbird",
"documentation": "https://www.home-assistant.io/components/doorbird",
"requirements": [
"doorbirdpy==2.0.6"
"doorbirdpy==2.0.8"
],
"dependencies": [],
"codeowners": [
@@ -344,7 +344,7 @@ distro==1.4.0
dlipower==0.7.165

# homeassistant.components.doorbird
doorbirdpy==2.0.6
doorbirdpy==2.0.8

# homeassistant.components.dovado
dovado==0.4.1
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.