From f09a66c083862a15d0a3f86bb1cacda53e9f339f Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Sun, 25 Oct 2020 14:01:03 +0000 Subject: [PATCH] Fix malformatted stream url for blink mini --- blinkpy/camera.py | 2 +- blinkpy/helpers/constants.py | 4 ++-- tests/test_cameras.py | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/blinkpy/camera.py b/blinkpy/camera.py index 87797b2b..186b8559 100644 --- a/blinkpy/camera.py +++ b/blinkpy/camera.py @@ -266,6 +266,6 @@ def get_liveview(self): response = api.http_post(self.sync.blink, url) server = response["server"] server_split = server.split(":") - server_split[0] = "rtsps" + server_split[0] = "rtsps:" link = "".join(server_split) return link diff --git a/blinkpy/helpers/constants.py b/blinkpy/helpers/constants.py index 4f24adca..29948e2c 100644 --- a/blinkpy/helpers/constants.py +++ b/blinkpy/helpers/constants.py @@ -3,8 +3,8 @@ import os MAJOR_VERSION = 0 -MINOR_VERSION = 16 -PATCH_VERSION = "4-rc0" +MINOR_VERSION = 17 +PATCH_VERSION = "0.dev1" __version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}.{PATCH_VERSION}" diff --git a/tests/test_cameras.py b/tests/test_cameras.py index 25bdaf06..8cf7d76f 100644 --- a/tests/test_cameras.py +++ b/tests/test_cameras.py @@ -176,3 +176,10 @@ def test_mini_missing_attributes(self, mock_resp): attr = camera.attributes for key in attr: self.assertEqual(attr[key], None) + + def test_camera_stream(self, mock_resp): + """Test that camera stream returns correct url.""" + mock_resp.return_value = {"server": "rtsps://foo.bar"} + mini_camera = BlinkCameraMini(self.blink.sync["test"]) + self.assertEqual(self.camera.get_liveview(), "rtsps://foo.bar") + self.assertEqual(mini_camera.get_liveview(), "rtsps://foo.bar")