A python wrapper for the Lovense API
Project description
lovense-api-wrapper
Overview
This is a simple Python wrapper library for the Lovense Standard Lan API, developed over a weekend to use in my personal projects. It implements one of the several available API methods and provides basic functionality. The library is fully functional and documented, but it is provided "as-is" and might not receive frequent updates from me.
Features
From lovense.api
- get_toys(): Gets the toy(s) connect to the Lovense app
- get_toys_name(): Same as get_toys() but just the name of the devices
- preset_request(): Send one of the pre-made or user created patterns
- function_request(): Send a single Pattern immediately
- pattern_request(): Avoids network pressure of multiple function commands
- stop(): Sends a stop immediately command
- decode_response(): Make the return value of any command more readable.
- pattern_request_raw(): More api accurate version for patterns (advanced)
- send_command(): Send a JSON command directly to the app (advanced)
Installation
You can install the library using pip:
cd lovense-api-wrapper
pip install .
Usage
Here's a basic example of how to use the library:
from lovense.api import GameModeWrapper
love = GameModeWrapper("My Cool App", "10.0.0.69")
print(love.get_toys()) # methods return the response from the server.
love.preset_request(love.presets.PULSE, time=5)
Check out this example file for more info.
Note: Setup the Lovense Remote App as follows:
- Lovense Remote App -> Discover -> Game Mode -> Enable LAN,
- Take node of the Local IP, and Port. It should match the GameModeWrapper constructor
Contributing
Contributions are welcome! While I'm not actively working on this project beyond my initial needs, I will address any bugs and review pull requests as they come up. If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request. If there's enough interest and demand, I'll consider dedicating more time to this project and building out more api methods.
Todo
If you are keen to add more to this library, here are the implemented API methods:
- Standard API / By local application
- Standard API / By server qr code
- Standard Socket API / By local
- Standard Socket API / By server
- Events API
These are all the API endpoints in the Standard API solution. Other API solutions seam less useful in the context of python.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Disclaimer
This library was created for personal use and is provided "as-is" without any warranties or guarantees. Use it at your own risk.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pylovense-0.1.tar.gz.
File metadata
- Download URL: pylovense-0.1.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a8ff3a0f272af43b7d9998a5dcba8601136dd64e0c2ebcae83afc4ef47cf586
|
|
| MD5 |
719cfa4ad87ac96c092c347844960d8c
|
|
| BLAKE2b-256 |
41c01a866293070c1478f348f3d9c6af1ff8b5b102c0f3e993a0865832f38d0c
|
File details
Details for the file pylovense-0.1-py3-none-any.whl.
File metadata
- Download URL: pylovense-0.1-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99e267c67912c45c518b01e2ff9ce351c400a783336087b9784ace0209649e9c
|
|
| MD5 |
8808f42e20ad27e86d76237997e80de4
|
|
| BLAKE2b-256 |
5ff3fa9fb974d5bb5280d00a3c48500c4ec5fa9823175201a8da7bd113a6beef
|