Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/colddenial/lovense-lan-api
Lovense Connect Library
https://github.com/colddenial/lovense-lan-api
Last synced: 9 days ago
JSON representation
Lovense Connect Library
- Host: GitHub
- URL: https://github.com/colddenial/lovense-lan-api
- Owner: colddenial
- Created: 2019-11-11T14:08:49.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-14T17:32:50.000Z (over 1 year ago)
- Last Synced: 2024-08-02T15:25:56.125Z (3 months ago)
- Language: Java
- Size: 286 KB
- Stars: 21
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lovense LAN Library #
This library provides a simple java interface to control lovense toys using lovense connect.
Example using getToys()
```java
public class Test
{
public static void main(String[] args)
{
//Trigger an immediate toy search and block until complete
LovenseConnect.refresh();//Fetch a collection of all toys found on the local network
Collection toys = LovenseConnect.getToys();// Cycle through each toy displaying its stats and setting the vibration to 50%
Iterator toyIterator = toys.iterator();
while(toyIterator.hasNext())
{
LovenseToy nextToy = toyIterator.next();
System.err.println(" Instance: " + nextToy.toString());
System.err.println(" Nickname: " + nextToy.getNickname());
System.err.println(" Name: " + nextToy.getName());
System.err.println(" id: " + nextToy.getId());
System.err.println(" Battery:" + String.valueOf(nextToy.getBattery()));
nextToy.vibrate(10); // Set toy to 50% vibration (0-20)
}
}
}
```Every call to getToys() also calls LovenseConnect.refreshIfNeeded() this will launch a thread to look for new devices using lovense's getToys API.
>Copyright (C) 2019 colddenial / openstatic.org
>This program is free software: you can redistribute it and/or modify
>it under the terms of the GNU General Public License as published by
>the Free Software Foundation, either version 3 of the License, or
>(at your option) any later version.>This program is distributed in the hope that it will be useful,
>but WITHOUT ANY WARRANTY; without even the implied warranty of
>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>GNU General Public License for more details.>You should have received a copy of the GNU General Public License
>along with this program. If not, see .
>