Skip to content

Commit

Permalink
Fix Set Setting URL in the Python SDK (#402)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcamise-gpsw committed Sep 21, 2023
1 parent 19026c9 commit acd7c30
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Unreleased
----------
* Fix BLE notifications not being routed correctly
* Don't hardcode media directory. Also append directory to filenames in media list.
* Fix malformed Set Setting HTTP url

0.14.0 (September-13-2022)
--------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -991,9 +991,9 @@ async def set(self, value: ValueType) -> GoProResp:
Returns:
GoProResp: Status of set
"""
value = value.value if isinstance(value, enum.Enum) else value
url = self._endpoint.format(int(self._identifier), value)
logger.info(Logger.build_log_tx_str(pretty_print(self._as_dict(value=value, endpoint=url))))
value = value.value if isinstance(value, enum.Enum) else value
# Send to camera
if response := await self._communicator._http_get(
url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import pytest

from open_gopro import Params
from open_gopro.gopro_base import GoProBase

camera_file = "100GOPRO/XXX.mp4"
Expand All @@ -18,6 +19,12 @@ async def test_get_with_no_params(mock_wifi_communicator: GoProBase):
assert response.url == "gopro/media/list"


@pytest.mark.asyncio
async def test_set_setting(mock_wifi_communicator: GoProBase):
response = await mock_wifi_communicator.http_setting.fps.set(Params.FPS.FPS_100)
assert response.url == "gopro/camera/setting?setting=3&option=2"


@pytest.mark.asyncio
async def test_get_with_params(mock_wifi_communicator: GoProBase):
zoom = 99
Expand Down

0 comments on commit acd7c30

Please sign in to comment.