diff --git a/bundles/org.openhab.core.io.rest.sitemap/src/main/java/org/openhab/core/io/rest/sitemap/internal/MappingDTO.java b/bundles/org.openhab.core.io.rest.sitemap/src/main/java/org/openhab/core/io/rest/sitemap/internal/MappingDTO.java index d7a91db61..4ba0ca048 100644 --- a/bundles/org.openhab.core.io.rest.sitemap/src/main/java/org/openhab/core/io/rest/sitemap/internal/MappingDTO.java +++ b/bundles/org.openhab.core.io.rest.sitemap/src/main/java/org/openhab/core/io/rest/sitemap/internal/MappingDTO.java @@ -18,12 +18,14 @@ package org.openhab.core.io.rest.sitemap.internal; * @author Kai Kreuzer - Initial contribution * @author Laurent Garnier - New fields position and icon * @author Laurent Garnier - Replace field position by fields row and column + * @author Laurent Garnier - New field releaseCommand */ public class MappingDTO { public Integer row; public Integer column; public String command; + public String releaseCommand; public String label; public String icon; diff --git a/bundles/org.openhab.core.io.rest.sitemap/src/main/java/org/openhab/core/io/rest/sitemap/internal/SitemapResource.java b/bundles/org.openhab.core.io.rest.sitemap/src/main/java/org/openhab/core/io/rest/sitemap/internal/SitemapResource.java index bc70d4d17..1a46c0d79 100644 --- a/bundles/org.openhab.core.io.rest.sitemap/src/main/java/org/openhab/core/io/rest/sitemap/internal/SitemapResource.java +++ b/bundles/org.openhab.core.io.rest.sitemap/src/main/java/org/openhab/core/io/rest/sitemap/internal/SitemapResource.java @@ -141,6 +141,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; * @author Laurent Garnier - Added icon field for mappings used for switch element * @author Laurent Garnier - Support added for multiple AND conditions in labelcolor/valuecolor/visibility * @author Laurent Garnier - New widget icon parameter based on conditional rules + * @author Laurent Garnier - Added releaseCmd field for mappings used for switch element */ @Component(service = { RESTResource.class, EventSubscriber.class }) @JaxrsResource @@ -635,6 +636,7 @@ public class SitemapResource for (Mapping mapping : switchWidget.getMappings()) { MappingDTO mappingBean = new MappingDTO(); mappingBean.command = mapping.getCmd(); + mappingBean.releaseCommand = mapping.getReleaseCmd(); mappingBean.label = mapping.getLabel(); mappingBean.icon = mapping.getIcon(); bean.mappings.add(mappingBean); diff --git a/bundles/org.openhab.core.model.sitemap/src/org/openhab/core/model/sitemap/Sitemap.xtext b/bundles/org.openhab.core.model.sitemap/src/org/openhab/core/model/sitemap/Sitemap.xtext index 37dad8bd6..bbb6f4afc 100644 --- a/bundles/org.openhab.core.model.sitemap/src/org/openhab/core/model/sitemap/Sitemap.xtext +++ b/bundles/org.openhab.core.model.sitemap/src/org/openhab/core/model/sitemap/Sitemap.xtext @@ -204,7 +204,7 @@ Button: row=INT ':' column=INT ':' cmd=Command '=' label=(ID | STRING) ('=' icon=Icon)?; Mapping: - cmd=Command '=' label=(ID | STRING) ('=' icon=Icon)?; + cmd=Command (':' releaseCmd=Command)? '=' label=(ID | STRING) ('=' icon=Icon)?; VisibilityRule: conditions+=Condition ('AND' conditions+=Condition)*;