-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a2b38bb
commit d8dd076
Showing
4 changed files
with
82 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 0 additions & 56 deletions
56
...mples/src/main/java/de/dvdgeisler/iot/dirigera/client/examples/customname/CustomName.java
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
...mples/src/main/java/de/dvdgeisler/iot/dirigera/client/examples/websockets/WebSockets.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package de.dvdgeisler.iot.dirigera.client.examples.websockets; | ||
|
||
import de.dvdgeisler.iot.dirigera.client.api.DirigeraApi; | ||
import de.dvdgeisler.iot.dirigera.client.api.http.ClientApi; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.boot.CommandLineRunner; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.ComponentScan; | ||
import reactor.core.publisher.Flux; | ||
|
||
/** | ||
* Lists all known devices | ||
*/ | ||
@SpringBootApplication | ||
@ComponentScan(basePackageClasses = {DirigeraApi.class}) | ||
public class WebSockets { | ||
private final static Logger log = LoggerFactory.getLogger(WebSockets.class); | ||
|
||
@Bean | ||
public CommandLineRunner run(final DirigeraApi api, final ClientApi capi) { | ||
|
||
return (String... args) -> { | ||
api.pairIfRequired().block(); // pair gateway if required | ||
|
||
capi.websocket(); | ||
}; | ||
} | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(WebSockets.class, args).close(); | ||
} | ||
|
||
|
||
} |