Coder Social home page Coder Social logo

linzn / wiim-java-api Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 47 KB

API Implementation of the WiiM-HTTP-API written in java to interact with WiiM devices.

Home Page: https://www.wiimhome.com/

License: MIT License

Java 100.00%
api java-api wiim wiimhome java streaming-audio

wiim-java-api's Introduction

wiim-java-api

What is wiim-java-api

The project wiim-java-api is a implementation of the WiiM HTTP API written in java to interact with WiiM devices.

The api is compatible with the following WiiM devices WiiMhome

Other WiiM devices may also work if they using the same httpAPI.

Java version

This library was built for Java 11.

API Information

This api is by default pulling information of the current WiiMDevice dataSet every 1000 milliseconds in the background. That means that using GET methods in the api will reflect data from the last successful pull.

However, SET methods will be applied instantly

How to install

Maven

<!-- https://builds.app.stem-system.de/plugin/repository/everything/de/linzn/wiim-java-api/ -->
<dependency>
    <groupId>de.linzn</groupId>
    <artifactId>wiim-java-api</artifactId>
    <version>1.0.0</version>
</dependency>

Javadocs & Documentation

In progress

Examples

import de.linzn.wiimJavaApi.WiimAPI;

public class ExampleDeviceStatus {
  /* IP Address of the device */
  static String wiimDeviceIPAddress = "10.50.0.99";

  public static void main(String[] args) throws InterruptedException {
      /* Creating a new wiimAPI instance with the ip address of the device */
      WiimAPI wiimAPI = new WiimAPI(wiimDeviceIPAddress);
      /* Disable ssl check because no valid certificate is given from the wiiMDevice by default */
      wiimAPI.setSslCheck(false);
      /* Connect to the httpAPI from the WiiMDevice */
      /* The current dataSet will be pulled automatic every 1000 ms*/
      wiimAPI.connect();

      /* Infinity loop to check frequently device status and the name of the device */
      while (true) {
          /* Get the current status of the player. Like "stop, play, ..."*/
          String name = wiimAPI.getDeviceInformation().get_DeviceName();
          String currentStatus = wiimAPI.getWiimPlayer().get_status();
          System.out.println("Current status of the device " + name + " is " + currentStatus);
          try {
              Thread.sleep(1000);
          } catch (InterruptedException ignored) {
          }
      }
  }
}

If you need some more examples to get started, check the examples' directory in this project. Any contribution is welcomed!

wiim-java-api's People

Contributors

linzn avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.