Skip to content

Commit d1fd4f3

Browse files
committed
Release to central and Update README.md
1 parent 6b64ef6 commit d1fd4f3

File tree

2 files changed

+43
-23
lines changed

2 files changed

+43
-23
lines changed

README.md

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,38 @@ This is a Java version of [mjg59](https://github.com/mjg59)'s [python-broadlink]
55

66
## Adding this API
77

8-
1. (Eclipse) Clone the project via ```git clone https://github.com/mob41/broadlink-java-api.git``` or via the [download ZIP](https://github.com/mob41/broadlink-java-api/archive/master.zip) and extract the ZIP to a folder.
8+
This API is distributed via **Maven Central**. You can import via adding this as dependency in Maven ```pom.xml``` or clone/download this as ZIP and import in IDE.
9+
10+
1. **Via Maven Central**: (Release Builds) Add the following to your ```pom.xml``` under ```<dependencies>```
11+
12+
```xml
13+
<dependency>
14+
<groupId>com.github.mob41.blapi</groupId>
15+
<artifactId>broadlink-java-api</artifactId>
16+
<version>1.0.1</version>
17+
</dependency>
18+
```
19+
20+
2. **Via OSSRH Snapshots**: (Development Builds) To access snapshots/development builds e.g. ```1.0.1-SNAPSHOT```, you have to add the OSSRH snapshot repository
21+
22+
```xml
23+
<profiles>
24+
<profile>
25+
<id>allow-snapshots</id>
26+
<activation><activeByDefault>true</activeByDefault></activation>
27+
<repositories>
28+
<repository>
29+
<id>snapshots-repo</id>
30+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
31+
<releases><enabled>false</enabled></releases>
32+
<snapshots><enabled>true</enabled></snapshots>
33+
</repository>
34+
</repositories>
35+
</profile>
36+
</profiles>
37+
```
38+
39+
3. **Via Cloning**: (Eclipse) Clone the project via ```git clone https://github.com/mob41/broadlink-java-api.git``` or via the [download ZIP](https://github.com/mob41/broadlink-java-api/archive/master.zip) and extract the ZIP to a folder.
940

1041
And add the project into your Eclipse IDE by right clicking the ```Package Explorer```, and,
1142
```Import...``` -> ```Maven``` -> ```Existing Maven Projects```
@@ -18,21 +49,9 @@ This is a Java version of [mjg59](https://github.com/mjg59)'s [python-broadlink]
1849
<dependency>
1950
<groupId>com.github.mob41.blapi</groupId>
2051
<artifactId>broadlink-java-api</artifactId>
21-
<version>0.0.1-SNAPSHOT</version>
52+
<version>1.0.1</version>
2253
</dependency>
2354
```
24-
25-
26-
2. Maven dependency: Add the following to your ```pom.xml``` under ```<dependencies>```
27-
28-
```xml
29-
<dependency>
30-
<groupId>com.github.mob41.blapi</groupId>
31-
<artifactId>broadlink-java-api</artifactId>
32-
<version>0.0.3-SNAPSHOT</version>
33-
</dependency>
34-
```
35-
3655

3756
## Tutorial
3857

@@ -44,11 +63,13 @@ This is a Java version of [mjg59](https://github.com/mjg59)'s [python-broadlink]
4463
import com.github.mob41.blapi.mac.Mac; //Necessary if using <code>2.ii</code>
4564
```
4665

47-
2. Creating a Broadlink device to connect
48-
49-
i. You can discover it.
66+
2. Creating/Discovering ```BLDevice``` instances by two methods:
5067

5168
```java
69+
//
70+
// === Method 1. By Discovering Devices In Local Network ===
71+
//
72+
5273
BLDevice[] devs = BLDevice.discoverDevices(); //Default with 10000 ms (10 sec) timeout, search for multiple devices
5374

5475
//BLDevice[] devs = BLDevice.discoverDevices(0); //No timeout will block the thread and search for one device only
@@ -64,17 +85,16 @@ This is a Java version of [mjg59](https://github.com/mjg59)'s [python-broadlink]
6485
}
6586

6687
//BLDevice dev = devs[0]
67-
```
68-
69-
ii. Create a <code>RM2Device</code> or another <code>BLDevice</code> child according to your device type
7088

71-
```java
89+
//
90+
// === Method 2. Create a "RM2Device" or another "BLDevice" child according to your device type ===
91+
//
92+
7293
BLDevice dev = new RM2Device("192.168.1.123", new Mac("01:12:23:34:43:320"));
7394
//~do stuff
7495
//dev.auth();
7596
```
7697

77-
7898
3. Before any commands like ```getTemp()``` and ```enterLearning()```, ```BLDevice.auth()``` must be ran to connect and authenticate with the Broadlink device.
7999

80100
```java

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,5 @@
142142
</plugins>
143143
</build>
144144

145-
<version>1.0.1-SNAPSHOT</version>
145+
<version>1.0.1</version>
146146
</project>

0 commit comments

Comments
 (0)