From 742282e1af765684cc99b600aaeea3272884cdc7 Mon Sep 17 00:00:00 2001 From: Jacob Laursen Date: Thu, 20 Apr 2023 20:36:44 +0200 Subject: [PATCH] Redefine connection in addon.xsd (#3563) * Redefine addon.xml connection * Remove remains of author Signed-off-by: Jacob Laursen GitOrigin-RevId: 4349be69456bd5371a22d3ea617bc3dee8518b6e --- .../schema/addon-1.0.0.xsd | 23 ++++++++++++++++--- .../org/openhab/core/addon/AddonInfo.java | 16 ++++--------- .../OH-INF/addon/addon.xml | 1 + .../acmeweather.bundle/OH-INF/addon/addon.xml | 1 + 4 files changed, 27 insertions(+), 14 deletions(-) diff --git a/bundles/org.opensmarthouse.core.addon/schema/addon-1.0.0.xsd b/bundles/org.opensmarthouse.core.addon/schema/addon-1.0.0.xsd index 5af9bacf6bd..21142133d17 100644 --- a/bundles/org.opensmarthouse.core.addon/schema/addon-1.0.0.xsd +++ b/bundles/org.opensmarthouse.core.addon/schema/addon-1.0.0.xsd @@ -51,9 +51,26 @@ - - - + + + No interaction with external systems at all + + + + + Interaction with external systems, without internet access + + + + + Interaction with external systems, internet access required only for extended functionality (such as discovery) + + + + + Interaction with external systems, internet access required for normal operation + + diff --git a/bundles/org.opensmarthouse.core.addon/src/main/java/org/openhab/core/addon/AddonInfo.java b/bundles/org.opensmarthouse.core.addon/src/main/java/org/openhab/core/addon/AddonInfo.java index 7094871fbc5..25c7593878b 100644 --- a/bundles/org.opensmarthouse.core.addon/src/main/java/org/openhab/core/addon/AddonInfo.java +++ b/bundles/org.opensmarthouse.core.addon/src/main/java/org/openhab/core/addon/AddonInfo.java @@ -46,9 +46,9 @@ public class AddonInfo implements Identifiable { private final String serviceId; private @Nullable String sourceBundle; - private AddonInfo(String id, String type, String name, String description, @Nullable String author, - @Nullable String connection, List countries, @Nullable String configDescriptionURI, - @Nullable String serviceId, @Nullable String sourceBundle) throws IllegalArgumentException { + private AddonInfo(String id, String type, String name, String description, @Nullable String connection, + List countries, @Nullable String configDescriptionURI, @Nullable String serviceId, + @Nullable String sourceBundle) throws IllegalArgumentException { // mandatory fields if (id.isBlank()) { throw new IllegalArgumentException("The ID must neither be null nor empty!"); @@ -153,7 +153,6 @@ public static class Builder { private final String type; private String name = ""; private String description = ""; - private @Nullable String author; private @Nullable String connection; private List countries = List.of(); private @Nullable String configDescriptionURI = ""; @@ -187,11 +186,6 @@ public Builder withDescription(String description) { return this; } - public Builder withAuthor(@Nullable String author) { - this.author = author; - return this; - } - public Builder withConnection(@Nullable String connection) { this.connection = connection; return this; @@ -229,8 +223,8 @@ public Builder withSourceBundle(@Nullable String sourceBundle) { * @throws IllegalArgumentException if any of the information in this builder is invalid */ public AddonInfo build() throws IllegalArgumentException { - return new AddonInfo(id, type, name, description, author, connection, countries, configDescriptionURI, - serviceId, sourceBundle); + return new AddonInfo(id, type, name, description, connection, countries, configDescriptionURI, serviceId, + sourceBundle); } } } diff --git a/itests/org.opensmarthouse.core.addon.tests/src/main/resources/test-bundle-pool/BundleInfoTest.bundle/OH-INF/addon/addon.xml b/itests/org.opensmarthouse.core.addon.tests/src/main/resources/test-bundle-pool/BundleInfoTest.bundle/OH-INF/addon/addon.xml index 0fec4bf2ffc..4d351403227 100644 --- a/itests/org.opensmarthouse.core.addon.tests/src/main/resources/test-bundle-pool/BundleInfoTest.bundle/OH-INF/addon/addon.xml +++ b/itests/org.opensmarthouse.core.addon.tests/src/main/resources/test-bundle-pool/BundleInfoTest.bundle/OH-INF/addon/addon.xml @@ -7,6 +7,7 @@ hue Binding The hue Binding integrates the Philips hue system. It allows to control hue lights. + local diff --git a/itests/org.opensmarthouse.core.addon.tests/src/main/resources/test-bundle-pool/acmeweather.bundle/OH-INF/addon/addon.xml b/itests/org.opensmarthouse.core.addon.tests/src/main/resources/test-bundle-pool/acmeweather.bundle/OH-INF/addon/addon.xml index 1fd540c81aa..543cf1ccc69 100644 --- a/itests/org.opensmarthouse.core.addon.tests/src/main/resources/test-bundle-pool/acmeweather.bundle/OH-INF/addon/addon.xml +++ b/itests/org.opensmarthouse.core.addon.tests/src/main/resources/test-bundle-pool/acmeweather.bundle/OH-INF/addon/addon.xml @@ -7,5 +7,6 @@ ACME Weather Binding The ACME Weather Binding requests the ACME Weather Service to show the current temperature, humidity and pressure. + cloud