Merge pull request #395 from fronzbot/fix-stream-format

Fix malformatted stream url for blink mini
This commit is contained in:
Kevin Fronczak
2020-10-25 10:09:28 -04:00
committed by GitHub
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)
server = response["server"]
server_split = server.split(":")
server_split[0] = "rtsps"
server_split[0] = "rtsps:"
link = "".join(server_split)
return link
+2 -2
View File
@@ -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}"
+7
View File
@@ -176,3 +176,10 @@ class TestBlinkCameraSetup(unittest.TestCase):
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")