mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-11-29 17:31:28 +00:00
Fix swapped pan directions for smartcam pantilt module (#1858)
Some checks failed
CI / Perform Lint Checks (3.15) (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.14 on macos-latest (push) Has been cancelled
CI / Python 3.15 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.14 on ubuntu-latest (push) Has been cancelled
CI / Python 3.15 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
CI / Python 3.14 on windows-latest (push) Has been cancelled
CI / Python 3.15 on windows-latest (push) Has been cancelled
Some checks failed
CI / Perform Lint Checks (3.15) (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.14 on macos-latest (push) Has been cancelled
CI / Python 3.15 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.14 on ubuntu-latest (push) Has been cancelled
CI / Python 3.15 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
CI / Python 3.14 on windows-latest (push) Has been cancelled
CI / Python 3.15 on windows-latest (push) Has been cancelled
This commit is contained in:
@@ -35,7 +35,7 @@ class PanTilt(SmartCamModule):
|
|||||||
"pan_right",
|
"pan_right",
|
||||||
"Pan right",
|
"Pan right",
|
||||||
container=self,
|
container=self,
|
||||||
attribute_setter=lambda: self.pan(self._pan_step * -1),
|
attribute_setter=lambda: self.pan(self._pan_step),
|
||||||
type=Feature.Type.Action,
|
type=Feature.Type.Action,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -45,7 +45,7 @@ class PanTilt(SmartCamModule):
|
|||||||
"pan_left",
|
"pan_left",
|
||||||
"Pan left",
|
"Pan left",
|
||||||
container=self,
|
container=self,
|
||||||
attribute_setter=lambda: self.pan(self._pan_step),
|
attribute_setter=lambda: self.pan(self._pan_step * -1),
|
||||||
type=Feature.Type.Action,
|
type=Feature.Type.Action,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -210,3 +210,25 @@ async def test_pantilt_no_presets_in_data(dev: Device, mocker: MockerFixture) ->
|
|||||||
|
|
||||||
assert pantilt_mod._presets == {}
|
assert pantilt_mod._presets == {}
|
||||||
assert pantilt_mod.presets == {}
|
assert pantilt_mod.presets == {}
|
||||||
|
|
||||||
|
|
||||||
|
@pantilt
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
("feature_id", "x_coord", "y_coord"),
|
||||||
|
[
|
||||||
|
("pan_right", "30", "0"),
|
||||||
|
("pan_left", "-30", "0"),
|
||||||
|
("tilt_up", "0", "10"),
|
||||||
|
("tilt_down", "0", "-10"),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
async def test_pantilt_direction_features(
|
||||||
|
dev: Device, mocker: MockerFixture, feature_id: str, x_coord: str, y_coord: str
|
||||||
|
) -> None:
|
||||||
|
mock_protocol_query = mocker.patch.object(dev.protocol, "query", return_value={})
|
||||||
|
|
||||||
|
await dev.features[feature_id].set_value(None)
|
||||||
|
|
||||||
|
mock_protocol_query.assert_called_with(
|
||||||
|
request={"do": {"motor": {"move": {"x_coord": x_coord, "y_coord": y_coord}}}}
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user