master
mail 1 year ago
parent c30ccc4944
commit 969f22b4e7

@ -0,0 +1 @@
Src changed

@ -12,5 +12,4 @@
webhostport="localhost:${deploytomcatport}"> webhostport="localhost:${deploytomcatport}">
<deploycopyinfo fromdir="${project}/target/${projectname}" <deploycopyinfo fromdir="${project}/target/${projectname}"
todir="${projectdeploy}"/> todir="${projectdeploy}"/>
<hotdeploymentpackage name="de.tvo.webportal.view"/>
</project> </project>

@ -1,41 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"> <classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> <classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes> <attributes>
<attribute name="test" value="true"/> <attribute name="test" value="true"/>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21">
<attributes> <attributes>
<attribute name="test" value="true"/> <attribute name="maven.pomderived" value="true"/>
<attribute name="maven.pomderived" value="true"/> </attributes>
<attribute name="optional" value="true"/> </classpathentry>
</attributes> <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
</classpathentry> <attributes>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21"> <attribute name="maven.pomderived" value="true"/>
<attributes> </attributes>
<attribute name="maven.pomderived" value="true"/> </classpathentry>
</attributes> <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
</classpathentry> <attributes>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> <attribute name="maven.pomderived" value="true"/>
<attributes> <attribute name="test" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="optional" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> </attributes>
</attributes> </classpathentry>
</classpathentry> <classpathentry kind="output" path="target/classes"/>
<classpathentry kind="output" path="target/classes"/> </classpath>
</classpath>

@ -1,7 +1,12 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21 org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=21 org.eclipse.jdt.core.compiler.compliance=21
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error

@ -1,10 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> <?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="webportal">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> <wb-module deploy-name="webportal">
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<property name="context-root" value="webportal"/> <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<property name="java-output-path" value="/webportal/target/classes"/>
</wb-module> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
</project-modules>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/java"/>
<property name="context-root" value="webportal"/>
<property name="java-output-path" value="/webportal/target/classes"/>
</wb-module>
</project-modules>

@ -31,11 +31,28 @@
</properties> </properties>
<dependencies> <dependencies>
<!-- Nanoleaf API Java -->
<!--
https://github.com/amybytes/nanoleaf-api
https://github.com/amybytes/nanoleaf-aurora
-->
<dependency>
<groupId>io.github.rowak</groupId>
<artifactId>nanoleaf-api</artifactId>
<version>0.1.2</version>
</dependency>
<dependency> <dependency>
<groupId>io.github.rowak</groupId> <groupId>io.github.rowak</groupId>
<artifactId>nanoleaf-api</artifactId> <artifactId>nanoleaf-aurora</artifactId>
<version>0.1.2</version> <version>1.5.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.eclnt</groupId> <groupId>org.eclnt</groupId>
<artifactId>eclntjsfserverRISC_jakarta</artifactId> <artifactId>eclntjsfserverRISC_jakarta</artifactId>

@ -0,0 +1,26 @@
package de.games.nanoleaf.server;
import java.util.List;
import io.github.rowak.nanoleafapi.NanoleafDevice;
import io.github.rowak.nanoleafapi.util.NanoleafDeviceMeta;
import io.github.rowak.nanoleafapi.util.NanoleafSetup;
public class NanoleafEventServer {
public static void main(String[] args) {
int timeout = 2000;
// List<NanoleafDeviceMeta> devices = NanoleafSetup.findNanoleafDevices(timeout);
// NanoleafDeviceMeta meta = devices.get(0); // Beispiel: Erster Gerät in der Liste
// String accessToken = NanoleafSetup.createAccessToken(meta.getHostName(), meta.getPort());
// NanoleafDevice device = NanoleafSetup.createDevice(meta, accessToken);
//
// // Event Handling
// device.setOnStateChangedListener(state -> {
// System.out.println("State changed: " + state.isOn());
// });
// Weitere Event-Listener hinzufügen, falls erforderlich
}
}

@ -1,7 +1,10 @@
package de.games.nanoleaf.server; package de.games.nanoleaf.server;
import java.util.Iterator;
import java.util.List; import java.util.List;
import io.github.rowak.nanoleafapi.Aurora;
import io.github.rowak.nanoleafapi.Panel;
import io.github.rowak.nanoleafapi.util.NanoleafDeviceMeta; import io.github.rowak.nanoleafapi.util.NanoleafDeviceMeta;
import io.github.rowak.nanoleafapi.util.NanoleafSetup; import io.github.rowak.nanoleafapi.util.NanoleafSetup;
@ -16,13 +19,66 @@ public class NanoleafServer {
public List<NanoleafDeviceMeta> getNanoleafDeviceList() { return m_nanoleafDeviceList; } public List<NanoleafDeviceMeta> getNanoleafDeviceList() { return m_nanoleafDeviceList; }
public NanoleafServer() { public NanoleafServer() {
String host = "Canvas-72FA.fritz.box";
int port = 16021;
String apiLevel = "v1";
String accessToken = "LAG28BQWrXK2p79NbHMQsvcYYCN1TcD4";
Aurora aurora = null;
try {
aurora = new Aurora(host, port, accessToken);
boolean isOn = aurora.getOn();
if (isOn) {
System.out.println("Nanoleaf ist an!!!");
int brightness = aurora.getBrightness();
System.out.println("Helligkeit: " + brightness);
List<Panel> panelList = aurora.getPanels();
for (Iterator iterator = panelList.iterator(); iterator.hasNext();) {
Panel panel = (Panel) iterator.next();
System.out.println("Panel ID: " + panel.getId());
}
} else {
System.out.println("Nanoleaf ist off!!!");
}
} catch (Exception e) {
e.printStackTrace();
}
}
public void checkAdressToken() {
int timeout = 2000; int timeout = 2000;
/* /*
* 192.168.178.138 Nanoleaf 4D * 192.168.178.138 Nanoleaf 4D
* *
* 192.168.178.139 Nanoleaf Canvas P17 * 192.168.178.141 Nanoleaf Canvas P17
* Canvas-72FA.fritz.box
*
* Nano Devices: 1
* Host: Canvas-72FA.fritz.box
* DevID: 192.168.178.141
* Port: 16021
* accessToken: LAG28BQWrXK2p79NbHMQsvcYYCN1TcD4
*
*
*/ */
try { try {
@ -34,6 +90,10 @@ public class NanoleafServer {
if (getNanoleafDeviceList().size() > 0) { if (getNanoleafDeviceList().size() > 0) {
meta = getNanoleafDeviceList().get(0); meta = getNanoleafDeviceList().get(0);
System.out.println("Host: " + meta.getHostName());
System.out.println("DevID: " + meta.getDeviceId());
System.out.println("Port: " + meta.getPort());
String accessToken = NanoleafSetup.createAccessToken(meta.getHostName(), meta.getPort()); String accessToken = NanoleafSetup.createAccessToken(meta.getHostName(), meta.getPort());
System.out.println("accessToken: " + accessToken); System.out.println("accessToken: " + accessToken);
@ -42,9 +102,9 @@ public class NanoleafServer {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
public static void main(String[] args) { public static void main(String[] args) {
new NanoleafServer(); new NanoleafServer();

@ -1,4 +0,0 @@
<hotdeploy>
<webappdir name="/eclnthotdeploy/classes"/>
<webappdir name="/eclnthotdeploy/lib"/>
</hotdeploy>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<t:layoutdefinition xmlns:t="http://www.CaptainCasa.com/controllibrary/t" > <t:layoutdefinition xmlns:t="http://www.CaptainCasa.com/controllibrary/t" >
<t:beanprocessing id="g_1" beanbinding="#{d.MainPage}" /> <t:beanprocessing id="g_1" beanbinding="#{d.MainPage}" />
<t:rowpagebeaninclude id="g_8" pagebeanbinding="#{d.MainPage.currentPage}" shownullcontent="true" /> <t:rowpagebeaninclude id="g_8" pagebeanbinding="#{d.MainPage.currentPage}" shownullcontent="true" />
</t:layoutdefinition> </t:layoutdefinition>
Loading…
Cancel
Save