JurajNyiri / pytapo

Python library for communication with Tapo Cameras
MIT License
277 stars 58 forks source link

Camera only moves to end Positions #100

Closed JasonGehring closed 7 months ago

JasonGehring commented 7 months ago

Hey! Thank you for this awesome library. I am currently looking into the possibility of adding C200 support to unifi-cam-proxy however I am not able to move the camera into any in between position.

tapo.moveMotorClockWise() and tapo.moveMotorStep(180) moves all the way into the end stop.

tapo.moveMotor("0.0000", "0.0000") crashes the camera with Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytapo/__init__.py", line 1118, in moveMotor return self.performRequest( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytapo/__init__.py", line 619, in performRequest raise Exception( Exception: Error: -60102, Response: {"error_code": -60102}

tapo.moveMotorStep(1) also crashes, but with Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytapo/__init__.py", line 1127, in moveMotorStep return self.performRequest( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytapo/__init__.py", line 619, in performRequest raise Exception( Exception: Error: -64316, Response: {"error_code": -64316}

I am sure there must be a way to control the camera into an in between position, but I could not figure out how?

JurajNyiri commented 7 months ago

You can use moveMotor.

https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/blob/main/custom_components/tapo_control/button.py#L156

Degrees argument is for example 5, 15... check other functions as well there.