ich habe mich mit OH3 etwas vertraut gemacht und würde mich gerne jetzt mit meiner Nutzeroberfläche auseinandersetzen. Ich habe in zwei Räumen eine Zeitschaltuhr über Selection-Items realisiert. Da OH3 im Interface kein Selection-Widget hat, habe ich etwas gesucht und einen Code für mich gefunden, der eigentlich reicht. Dieses sieht wie folgt aus:
Code: Alles auswählen
uid: Selection Zeitschaltuhren Ein
props:
parameters:
- description: Der Titel der Betriebsart
label: Titel
name: title
required: true
type: TEXT
- context: item
description: Das Item für das die Betriebsart eingestellt wird
label: Betriebsart Item
name: item
required: true
type: TEXT
parameterGroups: []
timestamp: Feb 11, 2021, 6:01:48 PM
component: oh-list-card
config:
title: =props.title
slots:
default:
- component: oh-list-item
config:
title: Aus
action: command
actionItem: =props.item
actionCommand: -1
icon: "=items[props.item].state === '-1' ? 'f7:circle_fill' : 'f7:circle'"
iconColor: red
- component: oh-list-item
config:
title: Automatik
action: command
actionItem: =props.item
actionCommand: 0
icon: "=items[props.item].state === '0' ? 'f7:circle_fill' : 'f7:circle'"
iconColor: red
- component: oh-list-item
config:
title: 17 Uhr
action: command
actionItem: =props.item
actionCommand: 1
icon: "=items[props.item].state === '1' ? 'f7:circle_fill' : 'f7:circle'"
iconColor: red
- component: oh-list-item
config:
title: 18 Uhr
action: command
actionItem: =props.item
actionCommand: 2
icon: "=items[props.item].state === '2' ? 'f7:circle_fill' : 'f7:circle'"
iconColor: red
- component: oh-list-item
config:
title: 19 Uhr
action: command
actionItem: =props.item
actionCommand: 3
icon: "=items[props.item].state === '3' ? 'f7:circle_fill' : 'f7:circle'"
iconColor: red
- component: oh-list-item
config:
title: 20 Uhr
action: command
actionItem: =props.item
actionCommand: 4
icon: "=items[props.item].state === '4' ? 'f7:circle_fill' : 'f7:circle'"
iconColor: red
Code: Alles auswählen
2021-02-11 18:04:08.214 [ERROR] [rg.apache.cxf.jaxrs.utils.JAXRSUtils] - No message body reader has been found for class java.lang.String, ContentType: application/octet-stream
2021-02-11 18:04:08.218 [WARN ] [s.impl.WebApplicationExceptionMapper] - javax.ws.rs.WebApplicationException: HTTP 415 Unsupported Media Type
at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.java:1382)
at org.apache.cxf.jaxrs.utils.JAXRSUtils.processRequestBodyParameter(JAXRSUtils.java:877)
at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:822)
at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:214)
at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:78)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:216)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:220)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:852)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:544)
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1581)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1307)
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:482)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1549)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1204)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:494)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918)
at java.base/java.lang.Thread.run(Thread.java:834)
Vielleicht kann mir hier jemand helfen?
EDIT: Ich möchte ebenfalls die Items in meiner UI in der Anordnung ändern. Leider finde ich die Möglichkeit dazu nicht. Diese werden einfach nur "stumpf" nebeneinander angeordnet. Wenn die Reihe voll ist, wird die nächste Angefangen. Ich möchte die Items aber lieber "frei" positionieren, so wie es im HABPanel möglich ist.
Dachte eigentlich dass es über "Configure Masonry" möglich ist, doch das Pop-Up ist komplett leer.
Hat hier ebenfalls jemand eine Idee?
MfG