LovensePy is a full-featured Python client designed for seamless integration with the Lovense API. It supports multiple modes including LAN Game Mode, Cloud Server API, and WebSocket management for real-time toy events. Built for high performance and asynchronous automation, it facilitates easy control and interaction with Lovense devices.
LovensePy is a robust Python client designed for seamless integration with the Lovense API. This powerful library supports various modes of operation, including LAN Game Mode, Cloud Server API, and the Socket API for WebSocket connections, enabling real-time toy events and efficient asynchronous automation.
Key Features
- Standard API LAN (Game Mode): Access commands such as
GetToys,Function,Stop,Pattern, andPreset. - Standard Server API: Interact with Lovense cloud services including
get_qr_codefunctionality for quick QR pairing. - Socket API: Utilizes WebSocket for real-time commands and interactions, facilitating remote control capabilities.
- Toy Events API: Capture real-time events such as toy status changes, button presses, and more, enhancing user interactions.
Quick Start Guide
Getting started with LovensePy is straightforward. First, ensure you have the Lovense Remote or Lovense Connect app installed and that your Lovense toy is paired. The client functionality can be initiated with just a few lines of code:
from lovensepy import LANClient, Actions
client = LANClient("MyApp", "192.168.1.100", port=20011)
client.function_request({Actions.VIBRATE: 10}, time=3)
This example demonstrates how to make your Lovense toy vibrate at level 10 for 3 seconds. The time parameter specifies the duration in seconds, allowing for a simple yet rich interaction with the device.
Comprehensive API Support
LovensePy offers a variety of client options depending on the connectivity method:
- LANClient: For direct communication over the local network using HTTP/HTTPS.
- ServerClient: Interacts with Lovense’s cloud for remote toy management, requiring a developer token and user ID.
- SocketAPIClient: An async client for handling WebSocket commands, ideal for real-time applications.
- ToyEventsClient: Focused on receiving events from connected toys, providing real-time feedback on toy interactions.
Usage Examples
The repository includes numerous examples for quick reference, such as:
- Controlling toys using LAN Game Mode.
- Utilizing presets for automated toy patterns.
- Implementing real-time event handling with the Toy Events API.
All functionalities come with detailed documentation and usage patterns, making it easier to leverage the full potential of the Lovense ecosystem.
Getting Help
For documentation, tutorials, and further assistance, refer to the GitHub repository where examples and detailed descriptions can guide users through setup and usage.
LovensePy stands out for its high performance and flexibility, ensuring an engaging experience with Lovense toys through straightforward API interactions.
No comments yet.
Sign in to be the first to comment.