Metadata-Version: 2.1
Name: pylove
Version: 1.0.3
Summary: A python implementation of the Lovense API
Home-page: https://github.com/catboy1357/pylove
Author: Catboy
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests

# PyLove

## Overview

This is a simple Python wrapper library for the **[Lovense Standard Lan API](https://developer.lovense.com/docs/standard-solutions/standard-api.html#game-mode)**, 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 pylove.lan**

- **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:

```bash
pip install pylove
```

## Usage

Here's a basic example of how to use the library:

```python
from pylove.lan 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](https://github.com/catboy1357/pylove/blob/main/gamemode_example.py)** for more info.

> **Note: Setup the Lovense Remote App as follows:**
>
> 1. Lovense Remote App -> Discover -> Game Mode -> Enable LAN,
> 2. 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:

- [x] 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](https://github.com/catboy1357/pylove/blob/main/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.

---
