Fix malformatted stream url for blink mini

This commit is contained in:
Kevin Fronczak
2020-10-25 14:01:03 +00:00
parent 88984365fe
commit f09a66c083
3 changed files with 10 additions and 3 deletions
+1 -1
View File
@@ -266,6 +266,6 @@ class BlinkCameraMini(BlinkCamera):
response = api.http_post(self.sync.blink, url) response = api.http_post(self.sync.blink, url)
server = response["server"] server = response["server"]
server_split = server.split(":") server_split = server.split(":")
server_split[0] = "rtsps" server_split[0] = "rtsps:"
link = "".join(server_split) link = "".join(server_split)
return link return link
+2 -2
View File
@@ -3,8 +3,8 @@
import os import os
MAJOR_VERSION = 0 MAJOR_VERSION = 0
MINOR_VERSION = 16 MINOR_VERSION = 17
PATCH_VERSION = "4-rc0" PATCH_VERSION = "0.dev1"
__version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}.{PATCH_VERSION}" __version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}.{PATCH_VERSION}"
+7
View File
@@ -176,3 +176,10 @@ class TestBlinkCameraSetup(unittest.TestCase):
attr = camera.attributes attr = camera.attributes
for key in attr: for key in attr:
self.assertEqual(attr[key], None) 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")