mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-10 13:21:53 +01:00
Add Input widget to main UI sitemap configuration and REST API (#3431)
* add input widget to UI SitemapProviderImpl * inputHint in UIComponentSitemapProvider * add input element to REST Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
This commit is contained in:
parent
e535510483
commit
44a146f5a8
@ -75,6 +75,7 @@ import org.openhab.core.model.sitemap.sitemap.Chart;
|
||||
import org.openhab.core.model.sitemap.sitemap.ColorArray;
|
||||
import org.openhab.core.model.sitemap.sitemap.Frame;
|
||||
import org.openhab.core.model.sitemap.sitemap.Image;
|
||||
import org.openhab.core.model.sitemap.sitemap.Input;
|
||||
import org.openhab.core.model.sitemap.sitemap.LinkableWidget;
|
||||
import org.openhab.core.model.sitemap.sitemap.Mapping;
|
||||
import org.openhab.core.model.sitemap.sitemap.Mapview;
|
||||
@ -558,6 +559,10 @@ public class SitemapResource
|
||||
bean.mappings.add(mappingBean);
|
||||
}
|
||||
}
|
||||
if (widget instanceof Input) {
|
||||
Input inputWidget = (Input) widget;
|
||||
bean.inputHint = inputWidget.getInputHint();
|
||||
}
|
||||
if (widget instanceof Slider) {
|
||||
Slider sliderWidget = (Slider) widget;
|
||||
bean.sendFrequency = sliderWidget.getFrequency();
|
||||
|
@ -47,6 +47,7 @@ public class WidgetDTO {
|
||||
public BigDecimal minValue;
|
||||
public BigDecimal maxValue;
|
||||
public BigDecimal step;
|
||||
public String inputHint;
|
||||
public String url;
|
||||
public String encoding;
|
||||
public String service;
|
||||
|
@ -45,6 +45,7 @@ import org.openhab.core.model.sitemap.sitemap.impl.DefaultImpl;
|
||||
import org.openhab.core.model.sitemap.sitemap.impl.FrameImpl;
|
||||
import org.openhab.core.model.sitemap.sitemap.impl.GroupImpl;
|
||||
import org.openhab.core.model.sitemap.sitemap.impl.ImageImpl;
|
||||
import org.openhab.core.model.sitemap.sitemap.impl.InputImpl;
|
||||
import org.openhab.core.model.sitemap.sitemap.impl.MappingImpl;
|
||||
import org.openhab.core.model.sitemap.sitemap.impl.MapviewImpl;
|
||||
import org.openhab.core.model.sitemap.sitemap.impl.SelectionImpl;
|
||||
@ -235,6 +236,11 @@ public class UIComponentSitemapProvider implements SitemapProvider, RegistryChan
|
||||
addWidgetMappings(selectionWidget.getMappings(), component);
|
||||
widget = selectionWidget;
|
||||
break;
|
||||
case "Input":
|
||||
InputImpl inputWidget = (InputImpl) SitemapFactory.eINSTANCE.createInput();
|
||||
widget = inputWidget;
|
||||
setWidgetPropertyFromComponentConfig(widget, component, "inputHint", SitemapPackage.INPUT__INPUT_HINT);
|
||||
break;
|
||||
case "Setpoint":
|
||||
SetpointImpl setpointWidget = (SetpointImpl) SitemapFactory.eINSTANCE.createSetpoint();
|
||||
widget = setpointWidget;
|
||||
|
Loading…
Reference in New Issue
Block a user