Skip to content

Commit

Permalink
Fix malformatted stream url for blink mini
Browse files Browse the repository at this point in the history
  • Loading branch information
fronzbot committed Oct 25, 2020
1 parent 8898436 commit f09a66c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion blinkpy/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions blinkpy/helpers/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
7 changes: 7 additions & 0 deletions tests/test_cameras.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit f09a66c

Please sign in to comment.