diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/RuleEventFactory.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/RuleEventFactory.java index ae33360a94..377c9a84d0 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/RuleEventFactory.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/RuleEventFactory.java @@ -43,13 +43,13 @@ public class RuleEventFactory extends AbstractEventFactory { private final Logger logger = LoggerFactory.getLogger(RuleEventFactory.class); - private static final String RULE_STATE_EVENT_TOPIC = "smarthome/rules/{ruleID}/state"; + private static final String RULE_STATE_EVENT_TOPIC = "openhab/rules/{ruleID}/state"; - private static final String RULE_ADDED_EVENT_TOPIC = "smarthome/rules/{ruleID}/added"; + private static final String RULE_ADDED_EVENT_TOPIC = "openhab/rules/{ruleID}/added"; - private static final String RULE_REMOVED_EVENT_TOPIC = "smarthome/rules/{ruleID}/removed"; + private static final String RULE_REMOVED_EVENT_TOPIC = "openhab/rules/{ruleID}/removed"; - private static final String RULE_UPDATED_EVENT_TOPIC = "smarthome/rules/{ruleID}/updated"; + private static final String RULE_UPDATED_EVENT_TOPIC = "openhab/rules/{ruleID}/updated"; private static final Set SUPPORTED_TYPES = new HashSet<>(); diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ChannelEventTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ChannelEventTriggerHandler.java index c78f450359..ea6476d985 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ChannelEventTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ChannelEventTriggerHandler.java @@ -42,7 +42,7 @@ public class ChannelEventTriggerHandler extends BaseTriggerModuleHandler impleme public static final String CFG_CHANNEL_EVENT = "event"; public static final String CFG_CHANNEL = "channelUID"; - public static final String TOPIC = "smarthome/channels/*/triggered"; + public static final String TOPIC = "openhab/channels/*/triggered"; private final Logger logger = LoggerFactory.getLogger(ChannelEventTriggerHandler.class); diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupCommandTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupCommandTriggerHandler.java index 64b4540550..4afab1998a 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupCommandTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupCommandTriggerHandler.java @@ -70,7 +70,7 @@ public class GroupCommandTriggerHandler extends BaseTriggerModuleHandler impleme this.types = Collections.singleton(ItemCommandEvent.TYPE); this.bundleContext = bundleContext; Dictionary properties = new Hashtable<>(); - this.topic = "smarthome/items/"; + this.topic = "openhab/items/"; properties.put("event.topics", topic); eventSubscriberRegistration = this.bundleContext.registerService(EventSubscriber.class.getName(), this, properties); diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupStateTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupStateTriggerHandler.java index 0ee5d5d706..69b4bcd885 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupStateTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupStateTriggerHandler.java @@ -82,7 +82,7 @@ public class GroupStateTriggerHandler extends BaseTriggerModuleHandler implement } this.bundleContext = bundleContext; Dictionary properties = new Hashtable<>(); - properties.put("event.topics", "smarthome/items/*"); + properties.put("event.topics", "openhab/items/*"); eventSubscriberRegistration = this.bundleContext.registerService(EventSubscriber.class.getName(), this, properties); } @@ -163,7 +163,7 @@ public class GroupStateTriggerHandler extends BaseTriggerModuleHandler implement @Override public boolean apply(Event event) { logger.trace("->FILTER: {}:{}", event.getTopic(), groupName); - return event.getTopic().startsWith("smarthome/items/"); + return event.getTopic().startsWith("openhab/items/"); } public void setItemRegistry(ItemRegistry itemRegistry) { diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemCommandTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemCommandTriggerHandler.java index 606abec895..718b121c45 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemCommandTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemCommandTriggerHandler.java @@ -64,7 +64,7 @@ public class ItemCommandTriggerHandler extends BaseTriggerModuleHandler implemen this.types = Collections.singleton(ItemCommandEvent.TYPE); this.bundleContext = bundleContext; Dictionary properties = new Hashtable<>(); - this.topic = "smarthome/items/" + itemName + "/command"; + this.topic = "openhab/items/" + itemName + "/command"; properties.put("event.topics", topic); eventSubscriberRegistration = this.bundleContext.registerService(EventSubscriber.class.getName(), this, properties); diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemStateTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemStateTriggerHandler.java index 57d9da0a53..9839cf0dd7 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemStateTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemStateTriggerHandler.java @@ -77,7 +77,7 @@ public class ItemStateTriggerHandler extends BaseTriggerModuleHandler implements } this.bundleContext = bundleContext; Dictionary properties = new Hashtable<>(); - properties.put("event.topics", "smarthome/items/" + itemName + "/*"); + properties.put("event.topics", "openhab/items/" + itemName + "/*"); eventSubscriberRegistration = this.bundleContext.registerService(EventSubscriber.class.getName(), this, properties); } @@ -143,6 +143,6 @@ public class ItemStateTriggerHandler extends BaseTriggerModuleHandler implements @Override public boolean apply(Event event) { logger.trace("->FILTER: {}:{}", event.getTopic(), itemName); - return event.getTopic().contains("smarthome/items/" + itemName + "/"); + return event.getTopic().contains("openhab/items/" + itemName + "/"); } } diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/SystemTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/SystemTriggerHandler.java index 5cbf289e23..6fbe7508b1 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/SystemTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/SystemTriggerHandler.java @@ -66,7 +66,7 @@ public class SystemTriggerHandler extends BaseTriggerModuleHandler implements Ev } this.bundleContext = bundleContext; Dictionary properties = new Hashtable<>(); - properties.put("event.topics", "smarthome/system/*"); + properties.put("event.topics", "openhab/system/*"); eventSubscriberRegistration = this.bundleContext.registerService(EventSubscriber.class.getName(), this, properties); } diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ThingStatusTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ThingStatusTriggerHandler.java index ff105234c4..9c2072d778 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ThingStatusTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ThingStatusTriggerHandler.java @@ -79,7 +79,7 @@ public class ThingStatusTriggerHandler extends BaseTriggerModuleHandler implemen } this.bundleContext = bundleContext; Dictionary properties = new Hashtable<>(); - properties.put("event.topics", "smarthome/things/" + thingUID + "/*"); + properties.put("event.topics", "openhab/things/" + thingUID + "/*"); eventSubscriberRegistration = this.bundleContext.registerService(EventSubscriber.class.getName(), this, properties); } @@ -144,6 +144,6 @@ public class ThingStatusTriggerHandler extends BaseTriggerModuleHandler implemen @Override public boolean apply(Event event) { logger.trace("->FILTER: {}: {}", event.getTopic(), thingUID); - return event.getTopic().contains("smarthome/things/" + thingUID + "/"); + return event.getTopic().contains("openhab/things/" + thingUID + "/"); } } diff --git a/bundles/org.openhab.core.automation/src/main/resources/OH-INF/automation/moduletypes/GenericTriggers.json b/bundles/org.openhab.core.automation/src/main/resources/OH-INF/automation/moduletypes/GenericTriggers.json index 9172fa0ea0..57cc345c97 100644 --- a/bundles/org.openhab.core.automation/src/main/resources/OH-INF/automation/moduletypes/GenericTriggers.json +++ b/bundles/org.openhab.core.automation/src/main/resources/OH-INF/automation/moduletypes/GenericTriggers.json @@ -10,9 +10,9 @@ "name": "eventTopic", "type": "TEXT", "label": "Topic", - "description": "This is the topic, the trigger will listen to: >>smarthome/*<<", + "description": "This is the topic, the trigger will listen to: >>openhab/*<<", "required": true, - "default": "smarthome/*" + "default": "openhab/*" }, { "name": "eventSource", diff --git a/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxEventFactory.java b/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxEventFactory.java index a11bc7995e..a03b155581 100644 --- a/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxEventFactory.java +++ b/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxEventFactory.java @@ -31,11 +31,11 @@ import org.osgi.service.component.annotations.Component; @Component(immediate = true, service = EventFactory.class) public class InboxEventFactory extends AbstractEventFactory { - static final String INBOX_ADDED_EVENT_TOPIC = "smarthome/inbox/{thingUID}/added"; + static final String INBOX_ADDED_EVENT_TOPIC = "openhab/inbox/{thingUID}/added"; - static final String INBOX_REMOVED_EVENT_TOPIC = "smarthome/inbox/{thingUID}/removed"; + static final String INBOX_REMOVED_EVENT_TOPIC = "openhab/inbox/{thingUID}/removed"; - static final String INBOX_UPDATED_EVENT_TOPIC = "smarthome/inbox/{thingUID}/updated"; + static final String INBOX_UPDATED_EVENT_TOPIC = "openhab/inbox/{thingUID}/updated"; /** * Constructs a new InboxEventFactory. diff --git a/bundles/org.openhab.core.io.rest.sse/src/test/java/org/openhab/core/io/rest/sse/internal/util/SseUtilTest.java b/bundles/org.openhab.core.io.rest.sse/src/test/java/org/openhab/core/io/rest/sse/internal/util/SseUtilTest.java index 49244c4e68..60a3abe319 100644 --- a/bundles/org.openhab.core.io.rest.sse/src/test/java/org/openhab/core/io/rest/sse/internal/util/SseUtilTest.java +++ b/bundles/org.openhab.core.io.rest.sse/src/test/java/org/openhab/core/io/rest/sse/internal/util/SseUtilTest.java @@ -28,88 +28,87 @@ public class SseUtilTest { @Test public void testValidInvalidFilters() { // invalid - assertThat(SseUtil.isValidTopicFilter("smarthome/.*"), is(false)); - assertThat(SseUtil.isValidTopicFilter("smarthome/\\w*/"), is(false)); + assertThat(SseUtil.isValidTopicFilter("openhab/.*"), is(false)); + assertThat(SseUtil.isValidTopicFilter("openhab/\\w*/"), is(false)); assertThat(SseUtil.isValidTopicFilter("sm.*/test/"), is(false)); - assertThat(SseUtil.isValidTopicFilter("smarthome.*"), is(false)); + assertThat(SseUtil.isValidTopicFilter("openhab.*"), is(false)); // valid - assertThat(SseUtil.isValidTopicFilter("smarthome"), is(true)); + assertThat(SseUtil.isValidTopicFilter("openhab"), is(true)); assertThat(SseUtil.isValidTopicFilter(""), is(true)); - assertThat(SseUtil.isValidTopicFilter(", smarthome/*"), is(true)); - assertThat(SseUtil.isValidTopicFilter("smarthome,qivicon"), is(true)); - assertThat(SseUtil.isValidTopicFilter("smarthome , qivicon"), is(true)); - assertThat(SseUtil.isValidTopicFilter("smarthome, qivicon"), is(true)); - assertThat(SseUtil.isValidTopicFilter("smarthome/test"), is(true)); - assertThat(SseUtil.isValidTopicFilter("smarthome/test/test/test/test/test"), is(true)); - assertThat( - SseUtil.isValidTopicFilter("smarthome/test/test/test/test/test, smarthome/test/test/test/test/test"), + assertThat(SseUtil.isValidTopicFilter(", openhab/*"), is(true)); + assertThat(SseUtil.isValidTopicFilter("openhab,qivicon"), is(true)); + assertThat(SseUtil.isValidTopicFilter("openhab , qivicon"), is(true)); + assertThat(SseUtil.isValidTopicFilter("openhab, qivicon"), is(true)); + assertThat(SseUtil.isValidTopicFilter("openhab/test"), is(true)); + assertThat(SseUtil.isValidTopicFilter("openhab/test/test/test/test/test"), is(true)); + assertThat(SseUtil.isValidTopicFilter("openhab/test/test/test/test/test, openhab/test/test/test/test/test"), is(true)); assertThat( SseUtil.isValidTopicFilter( - "smarthome/test/test/test/test/test, smarthome/test/test/test/test/test, smarthome,qivicon"), + "openhab/test/test/test/test/test, openhab/test/test/test/test/test, openhab,qivicon"), is(true)); assertThat(SseUtil.isValidTopicFilter("////////////"), is(true)); assertThat(SseUtil.isValidTopicFilter("*/added"), is(true)); assertThat(SseUtil.isValidTopicFilter("*added"), is(true)); - assertThat(SseUtil.isValidTopicFilter("smarthome/test/test:test:123/test"), is(true)); - assertThat(SseUtil.isValidTopicFilter("smarthome/test/test-test-123-test:test:123/test"), is(true)); + assertThat(SseUtil.isValidTopicFilter("openhab/test/test:test:123/test"), is(true)); + assertThat(SseUtil.isValidTopicFilter("openhab/test/test-test-123-test:test:123/test"), is(true)); } @Test public void testFilterMatchers() { - List regexes = SseUtil.convertToRegex( - "smarthome/*/test/test/test/test, smarthome/test/*/test/test/test, smarthome,qivicon"); + List regexes = SseUtil + .convertToRegex("openhab/*/test/test/test/test, openhab/test/*/test/test/test, openhab,qivicon"); - assertThat("smarthome/test/test/test/test/test".matches(regexes.get(0)), is(true)); - assertThat("smarthome/asdf/test/test/test/test".matches(regexes.get(0)), is(true)); - assertThat("smarthome/asdf/ASDF/test/test/test".matches(regexes.get(0)), is(false)); + assertThat("openhab/test/test/test/test/test".matches(regexes.get(0)), is(true)); + assertThat("openhab/asdf/test/test/test/test".matches(regexes.get(0)), is(true)); + assertThat("openhab/asdf/ASDF/test/test/test".matches(regexes.get(0)), is(false)); - assertThat("smarthome/test/test/test/test/test".matches(regexes.get(1)), is(true)); - assertThat("smarthome/asdf/test/test/test/test".matches(regexes.get(1)), is(false)); - assertThat("smarthome/asdf/ASDF/test/test/test".matches(regexes.get(1)), is(false)); + assertThat("openhab/test/test/test/test/test".matches(regexes.get(1)), is(true)); + assertThat("openhab/asdf/test/test/test/test".matches(regexes.get(1)), is(false)); + assertThat("openhab/asdf/ASDF/test/test/test".matches(regexes.get(1)), is(false)); - assertThat("smarthome/test/test/test/test/test".matches(regexes.get(2)), is(true)); - assertThat("smarthome/asdf/test/test/test/test".matches(regexes.get(2)), is(true)); - assertThat("smarthome/asdf/ASDF/test/test/test".matches(regexes.get(2)), is(true)); + assertThat("openhab/test/test/test/test/test".matches(regexes.get(2)), is(true)); + assertThat("openhab/asdf/test/test/test/test".matches(regexes.get(2)), is(true)); + assertThat("openhab/asdf/ASDF/test/test/test".matches(regexes.get(2)), is(true)); - assertThat("smarthome/test/test/test/test/test".matches(regexes.get(3)), is(false)); - assertThat("smarthome/asdf/test/test/test/test".matches(regexes.get(3)), is(false)); + assertThat("openhab/test/test/test/test/test".matches(regexes.get(3)), is(false)); + assertThat("openhab/asdf/test/test/test/test".matches(regexes.get(3)), is(false)); assertThat("qivicon/asdf/ASDF/test/test/test".matches(regexes.get(3)), is(true)); } @Test public void testMoreFilterMatchers() { - List regexes = SseUtil.convertToRegex(", *, smarthome/items/*/added, smarthome/items"); + List regexes = SseUtil.convertToRegex(", *, openhab/items/*/added, openhab/items"); - assertThat("smarthome/test/test/test/test/test".matches(regexes.get(0)), is(true)); - assertThat("smarthome/asdf/test/test/test/test".matches(regexes.get(0)), is(true)); - assertThat("smarthome/asdf/ASDF/test/test/test".matches(regexes.get(0)), is(true)); + assertThat("openhab/test/test/test/test/test".matches(regexes.get(0)), is(true)); + assertThat("openhab/asdf/test/test/test/test".matches(regexes.get(0)), is(true)); + assertThat("openhab/asdf/ASDF/test/test/test".matches(regexes.get(0)), is(true)); - assertThat("smarthome/test/test/test/test/test".matches(regexes.get(1)), is(false)); - assertThat("smarthome/items/anyitem/added".matches(regexes.get(1)), is(true)); - assertThat("smarthome/items/anyitem/removed".matches(regexes.get(1)), is(false)); + assertThat("openhab/test/test/test/test/test".matches(regexes.get(1)), is(false)); + assertThat("openhab/items/anyitem/added".matches(regexes.get(1)), is(true)); + assertThat("openhab/items/anyitem/removed".matches(regexes.get(1)), is(false)); - assertThat("smarthome/items/anyitem/added".matches(regexes.get(2)), is(true)); - assertThat("smarthome/items/anyitem/removed".matches(regexes.get(2)), is(true)); - assertThat("smarthome/items/anyitem/updated".matches(regexes.get(2)), is(true)); - assertThat("smarthome/things/anything/updated".matches(regexes.get(2)), is(false)); + assertThat("openhab/items/anyitem/added".matches(regexes.get(2)), is(true)); + assertThat("openhab/items/anyitem/removed".matches(regexes.get(2)), is(true)); + assertThat("openhab/items/anyitem/updated".matches(regexes.get(2)), is(true)); + assertThat("openhab/things/anything/updated".matches(regexes.get(2)), is(false)); } @Test public void testEvenMoreFilterMatchers() { List regexes = SseUtil.convertToRegex(""); - assertThat("smarthome/test/test/test/test/test".matches(regexes.get(0)), is(true)); - assertThat("smarthome/asdf/test/test/test/test".matches(regexes.get(0)), is(true)); - assertThat("smarthome/asdf/ASDF/test/test/test".matches(regexes.get(0)), is(true)); + assertThat("openhab/test/test/test/test/test".matches(regexes.get(0)), is(true)); + assertThat("openhab/asdf/test/test/test/test".matches(regexes.get(0)), is(true)); + assertThat("openhab/asdf/ASDF/test/test/test".matches(regexes.get(0)), is(true)); regexes = SseUtil.convertToRegex("*/added"); - assertThat("smarthome/items/anyitem/added".matches(regexes.get(0)), is(true)); - assertThat("smarthome/items/anyitem/removed".matches(regexes.get(0)), is(false)); + assertThat("openhab/items/anyitem/added".matches(regexes.get(0)), is(true)); + assertThat("openhab/items/anyitem/removed".matches(regexes.get(0)), is(false)); regexes = SseUtil.convertToRegex("*added"); - assertThat("smarthome/items/anyitem/added".matches(regexes.get(0)), is(true)); - assertThat("smarthome/items/anyitem/removed".matches(regexes.get(0)), is(false)); + assertThat("openhab/items/anyitem/added".matches(regexes.get(0)), is(true)); + assertThat("openhab/items/anyitem/removed".matches(regexes.get(0)), is(false)); } } diff --git a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/ThingConfigStatusSource.java b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/ThingConfigStatusSource.java index c31ba75ba1..495636b2fe 100644 --- a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/ThingConfigStatusSource.java +++ b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/ThingConfigStatusSource.java @@ -24,7 +24,7 @@ import org.openhab.core.thing.Thing; @NonNullByDefault public final class ThingConfigStatusSource extends ConfigStatusSource { - private static final String TOPIC = "smarthome/things/{thingUID}/config/status"; + private static final String TOPIC = "openhab/things/{thingUID}/config/status"; /** * Creates a new {@link ThingConfigStatusSource} for the given thing UID. diff --git a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/events/ThingEventFactory.java b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/events/ThingEventFactory.java index a2cf1c3086..88bf499b70 100644 --- a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/events/ThingEventFactory.java +++ b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/events/ThingEventFactory.java @@ -37,17 +37,17 @@ import org.osgi.service.component.annotations.Component; */ @Component(immediate = true, service = EventFactory.class) public class ThingEventFactory extends AbstractEventFactory { - static final String THING_STATUS_INFO_EVENT_TOPIC = "smarthome/things/{thingUID}/status"; + static final String THING_STATUS_INFO_EVENT_TOPIC = "openhab/things/{thingUID}/status"; - static final String THING_STATUS_INFO_CHANGED_EVENT_TOPIC = "smarthome/things/{thingUID}/statuschanged"; + static final String THING_STATUS_INFO_CHANGED_EVENT_TOPIC = "openhab/things/{thingUID}/statuschanged"; - static final String THING_ADDED_EVENT_TOPIC = "smarthome/things/{thingUID}/added"; + static final String THING_ADDED_EVENT_TOPIC = "openhab/things/{thingUID}/added"; - static final String THING_REMOVED_EVENT_TOPIC = "smarthome/things/{thingUID}/removed"; + static final String THING_REMOVED_EVENT_TOPIC = "openhab/things/{thingUID}/removed"; - static final String THING_UPDATED_EVENT_TOPIC = "smarthome/things/{thingUID}/updated"; + static final String THING_UPDATED_EVENT_TOPIC = "openhab/things/{thingUID}/updated"; - static final String CHANNEL_TRIGGERED_EVENT_TOPIC = "smarthome/channels/{channelUID}/triggered"; + static final String CHANNEL_TRIGGERED_EVENT_TOPIC = "openhab/channels/{channelUID}/triggered"; /** * Constructs a new ThingEventFactory. diff --git a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/firmware/FirmwareEventFactory.java b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/firmware/FirmwareEventFactory.java index 155308760f..ce10764ee9 100644 --- a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/firmware/FirmwareEventFactory.java +++ b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/firmware/FirmwareEventFactory.java @@ -37,9 +37,9 @@ public final class FirmwareEventFactory extends AbstractEventFactory { static final String THING_UID_TOPIC_KEY = "{thingUID}"; - static final String FIRMWARE_STATUS_TOPIC = "smarthome/things/{thingUID}/firmware/status"; - static final String FIRMWARE_UPDATE_PROGRESS_TOPIC = "smarthome/things/{thingUID}/firmware/update/progress"; - static final String FIRMWARE_UPDATE_RESULT_TOPIC = "smarthome/things/{thingUID}/firmware/update/result"; + static final String FIRMWARE_STATUS_TOPIC = "openhab/things/{thingUID}/firmware/status"; + static final String FIRMWARE_UPDATE_PROGRESS_TOPIC = "openhab/things/{thingUID}/firmware/update/progress"; + static final String FIRMWARE_UPDATE_RESULT_TOPIC = "openhab/things/{thingUID}/firmware/update/result"; /** * Creates a new firmware event factory. diff --git a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/link/events/LinkEventFactory.java b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/link/events/LinkEventFactory.java index e060e6a5f6..00ead5cffd 100644 --- a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/link/events/LinkEventFactory.java +++ b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/link/events/LinkEventFactory.java @@ -35,9 +35,9 @@ import org.osgi.service.component.annotations.Component; @Component(immediate = true, service = EventFactory.class) public class LinkEventFactory extends AbstractEventFactory { - private static final String LINK_ADDED_EVENT_TOPIC = "smarthome/links/{linkID}/added"; + private static final String LINK_ADDED_EVENT_TOPIC = "openhab/links/{linkID}/added"; - private static final String LINK_REMOVED_EVENT_TOPIC = "smarthome/links/{linkID}/removed"; + private static final String LINK_REMOVED_EVENT_TOPIC = "openhab/links/{linkID}/removed"; /** * Constructs a new LinkEventFactory. diff --git a/bundles/org.openhab.core/src/main/java/org/openhab/core/addon/AddonEventFactory.java b/bundles/org.openhab.core/src/main/java/org/openhab/core/addon/AddonEventFactory.java index b6690541db..152be4b388 100644 --- a/bundles/org.openhab.core/src/main/java/org/openhab/core/addon/AddonEventFactory.java +++ b/bundles/org.openhab.core/src/main/java/org/openhab/core/addon/AddonEventFactory.java @@ -30,7 +30,7 @@ import org.osgi.service.component.annotations.Component; @Component(service = EventFactory.class, immediate = true) public class AddonEventFactory extends AbstractEventFactory { - static final String TOPIC_PREFIX = "smarthome/addons/{id}"; + static final String TOPIC_PREFIX = "openhab/addons/{id}"; static final String ADDON_INSTALLED_EVENT_TOPIC_POSTFIX = "/installed"; static final String ADDON_UNINSTALLED_EVENT_TOPIC_POSTFIX = "/uninstalled"; diff --git a/bundles/org.openhab.core/src/main/java/org/openhab/core/events/system/SystemEventFactory.java b/bundles/org.openhab.core/src/main/java/org/openhab/core/events/system/SystemEventFactory.java index d6a85d62fc..c618716c97 100644 --- a/bundles/org.openhab.core/src/main/java/org/openhab/core/events/system/SystemEventFactory.java +++ b/bundles/org.openhab.core/src/main/java/org/openhab/core/events/system/SystemEventFactory.java @@ -32,7 +32,7 @@ import org.osgi.service.component.annotations.Component; @NonNullByDefault public class SystemEventFactory extends AbstractEventFactory { - static final String SYSTEM_STARTLEVEL_TOPIC = "smarthome/system/startlevel"; + static final String SYSTEM_STARTLEVEL_TOPIC = "openhab/system/startlevel"; public SystemEventFactory() { super(Stream.of(StartlevelEvent.TYPE).collect(Collectors.toSet())); diff --git a/bundles/org.openhab.core/src/main/java/org/openhab/core/internal/events/OSGiEventManager.java b/bundles/org.openhab.core/src/main/java/org/openhab/core/internal/events/OSGiEventManager.java index 53a04561bd..d4b23a9655 100644 --- a/bundles/org.openhab.core/src/main/java/org/openhab/core/internal/events/OSGiEventManager.java +++ b/bundles/org.openhab.core/src/main/java/org/openhab/core/internal/events/OSGiEventManager.java @@ -40,7 +40,7 @@ import org.osgi.service.event.EventHandler; * @author Stefan Bußweiler - Initial contribution * @author Markus Rathgeb - Return on received events as fast as possible (handle event in another thread) */ -@Component(immediate = true, property = { "event.topics:String=smarthome" }) +@Component(immediate = true, property = { "event.topics:String=openhab" }) public class OSGiEventManager implements EventHandler { /** The event subscribers indexed by the event type. */ diff --git a/bundles/org.openhab.core/src/main/java/org/openhab/core/internal/events/OSGiEventPublisher.java b/bundles/org.openhab.core/src/main/java/org/openhab/core/internal/events/OSGiEventPublisher.java index 54b4a61896..0b15b5a156 100644 --- a/bundles/org.openhab.core/src/main/java/org/openhab/core/internal/events/OSGiEventPublisher.java +++ b/bundles/org.openhab.core/src/main/java/org/openhab/core/internal/events/OSGiEventPublisher.java @@ -67,7 +67,7 @@ public class OSGiEventPublisher implements EventPublisher { if (event.getSource() != null) { properties.put("source", event.getSource()); } - eventAdmin.postEvent(new org.osgi.service.event.Event("smarthome", properties)); + eventAdmin.postEvent(new org.osgi.service.event.Event("openhab", properties)); return null; } }); diff --git a/bundles/org.openhab.core/src/main/java/org/openhab/core/items/events/ItemEventFactory.java b/bundles/org.openhab.core/src/main/java/org/openhab/core/items/events/ItemEventFactory.java index 6bc1d288c8..6b22ba32a5 100644 --- a/bundles/org.openhab.core/src/main/java/org/openhab/core/items/events/ItemEventFactory.java +++ b/bundles/org.openhab.core/src/main/java/org/openhab/core/items/events/ItemEventFactory.java @@ -45,21 +45,21 @@ public class ItemEventFactory extends AbstractEventFactory { private static final String CORE_LIBRARY_PACKAGE = "org.openhab.core.library.types."; - private static final String ITEM_COMAND_EVENT_TOPIC = "smarthome/items/{itemName}/command"; + private static final String ITEM_COMAND_EVENT_TOPIC = "openhab/items/{itemName}/command"; - private static final String ITEM_STATE_EVENT_TOPIC = "smarthome/items/{itemName}/state"; + private static final String ITEM_STATE_EVENT_TOPIC = "openhab/items/{itemName}/state"; - private static final String ITEM_STATE_PREDICTED_EVENT_TOPIC = "smarthome/items/{itemName}/statepredicted"; + private static final String ITEM_STATE_PREDICTED_EVENT_TOPIC = "openhab/items/{itemName}/statepredicted"; - private static final String ITEM_STATE_CHANGED_EVENT_TOPIC = "smarthome/items/{itemName}/statechanged"; + private static final String ITEM_STATE_CHANGED_EVENT_TOPIC = "openhab/items/{itemName}/statechanged"; - private static final String GROUPITEM_STATE_CHANGED_EVENT_TOPIC = "smarthome/items/{itemName}/{memberName}/statechanged"; + private static final String GROUPITEM_STATE_CHANGED_EVENT_TOPIC = "openhab/items/{itemName}/{memberName}/statechanged"; - private static final String ITEM_ADDED_EVENT_TOPIC = "smarthome/items/{itemName}/added"; + private static final String ITEM_ADDED_EVENT_TOPIC = "openhab/items/{itemName}/added"; - private static final String ITEM_REMOVED_EVENT_TOPIC = "smarthome/items/{itemName}/removed"; + private static final String ITEM_REMOVED_EVENT_TOPIC = "openhab/items/{itemName}/removed"; - private static final String ITEM_UPDATED_EVENT_TOPIC = "smarthome/items/{itemName}/updated"; + private static final String ITEM_UPDATED_EVENT_TOPIC = "openhab/items/{itemName}/updated"; /** * Constructs a new ItemEventFactory. diff --git a/bundles/org.openhab.core/src/test/java/org/openhab/core/items/GenericItemTest.java b/bundles/org.openhab.core/src/test/java/org/openhab/core/items/GenericItemTest.java index 0c1b097d15..f029a69556 100644 --- a/bundles/org.openhab.core/src/test/java/org/openhab/core/items/GenericItemTest.java +++ b/bundles/org.openhab.core/src/test/java/org/openhab/core/items/GenericItemTest.java @@ -68,7 +68,7 @@ public class GenericItemTest { ItemStateChangedEvent change = captor.getValue(); assertEquals(item.getName(), change.getItemName()); - assertEquals("smarthome/items/member1/statechanged", change.getTopic()); + assertEquals("openhab/items/member1/statechanged", change.getTopic()); assertEquals(oldState, change.getOldItemState()); assertEquals(item.getState(), change.getItemState()); assertEquals(ItemStateChangedEvent.TYPE, change.getType()); diff --git a/bundles/org.openhab.core/src/test/java/org/openhab/core/items/events/AbstractEventFactoryTest.java b/bundles/org.openhab.core/src/test/java/org/openhab/core/items/events/AbstractEventFactoryTest.java index 29b32760c1..434714bb33 100644 --- a/bundles/org.openhab.core/src/test/java/org/openhab/core/items/events/AbstractEventFactoryTest.java +++ b/bundles/org.openhab.core/src/test/java/org/openhab/core/items/events/AbstractEventFactoryTest.java @@ -27,7 +27,7 @@ public class AbstractEventFactoryTest { private static final String SOURCE = "binding:type:id:channel"; private static final String EVENT_TYPE = "SOME_EVENT_TYPE"; - private static final String EVENT_TOPIC = "smarthome/some/topic"; + private static final String EVENT_TOPIC = "openhab/some/topic"; private static final String EVENT_PAYLOAD = "{\"some\":\"payload\"}"; @Test diff --git a/bundles/org.openhab.core/src/test/java/org/openhab/core/items/events/ItemEventFactoryTest.java b/bundles/org.openhab.core/src/test/java/org/openhab/core/items/events/ItemEventFactoryTest.java index b1bb2fa5d4..92b7844445 100644 --- a/bundles/org.openhab.core/src/test/java/org/openhab/core/items/events/ItemEventFactoryTest.java +++ b/bundles/org.openhab.core/src/test/java/org/openhab/core/items/events/ItemEventFactoryTest.java @@ -50,11 +50,11 @@ public class ItemEventFactoryTest { private static final String ITEM_ADDED_EVENT_TYPE = ItemAddedEvent.TYPE; private static final String GROUPITEM_CHANGED_EVENT_TYPE = GroupItemStateChangedEvent.TYPE; - private static final String ITEM_COMMAND_EVENT_TOPIC = "smarthome/items/" + ITEM_NAME + "/command"; - private static final String ITEM_STATE_EVENT_TOPIC = "smarthome/items/" + ITEM_NAME + "/state"; - private static final String ITEM_STATE_PREDICTED_EVENT_TOPIC = "smarthome/items/" + ITEM_NAME + "/statepredicted"; - private static final String ITEM_ADDED_EVENT_TOPIC = "smarthome/items/" + ITEM_NAME + "/added"; - private static final String GROUPITEM_STATE_CHANGED_EVENT_TOPIC = "smarthome/items/" + GROUP_NAME + "/" + ITEM_NAME + private static final String ITEM_COMMAND_EVENT_TOPIC = "openhab/items/" + ITEM_NAME + "/command"; + private static final String ITEM_STATE_EVENT_TOPIC = "openhab/items/" + ITEM_NAME + "/state"; + private static final String ITEM_STATE_PREDICTED_EVENT_TOPIC = "openhab/items/" + ITEM_NAME + "/statepredicted"; + private static final String ITEM_ADDED_EVENT_TOPIC = "openhab/items/" + ITEM_NAME + "/added"; + private static final String GROUPITEM_STATE_CHANGED_EVENT_TOPIC = "openhab/items/" + GROUP_NAME + "/" + ITEM_NAME + "/statechanged"; private static final Command ITEM_COMMAND = OnOffType.ON; diff --git a/itests/org.openhab.core.automation.integration.tests/src/main/java/org/openhab/core/automation/integration/test/AutomationIntegrationJsonTest.java b/itests/org.openhab.core.automation.integration.tests/src/main/java/org/openhab/core/automation/integration/test/AutomationIntegrationJsonTest.java index 615967468b..b6b5c0be65 100644 --- a/itests/org.openhab.core.automation.integration.tests/src/main/java/org/openhab/core/automation/integration/test/AutomationIntegrationJsonTest.java +++ b/itests/org.openhab.core.automation.integration.tests/src/main/java/org/openhab/core/automation/integration/test/AutomationIntegrationJsonTest.java @@ -248,7 +248,7 @@ public class AutomationIntegrationJsonTest extends JavaOSGiTest { assertThat(trigger.isPresent(), is(true)); assertThat(trigger.get().getTypeUID(), is("core.GenericEventTrigger")); assertThat(trigger.get().getConfiguration().get("eventSource"), is("myMotionItem")); - assertThat(trigger.get().getConfiguration().get("eventTopic"), is("smarthome/items/*")); + assertThat(trigger.get().getConfiguration().get("eventTopic"), is("openhab/items/*")); assertThat(trigger.get().getConfiguration().get("eventTypes"), is("ItemStateEvent")); Optional action = rule.getActions().stream() .filter(a -> "ItemPostCommandActionID".equals(a.getId())).findFirst(); @@ -287,7 +287,7 @@ public class AutomationIntegrationJsonTest extends JavaOSGiTest { .filter(t -> "ItemStateChangeTriggerID".equals(t.getId())).findFirst(); assertThat(trigger.isPresent(), is(true)); assertThat(trigger.get().getTypeUID(), is("core.GenericEventTrigger")); - assertThat(trigger.get().getConfiguration().get("eventTopic"), is("smarthome/items/*")); + assertThat(trigger.get().getConfiguration().get("eventTopic"), is("openhab/items/*")); assertThat(trigger.get().getConfiguration().get("eventTypes"), is("ItemStateEvent")); Optional action = rule.getActions().stream() .filter(a -> "ItemPostCommandActionID".equals(a.getId())).findFirst(); @@ -327,7 +327,7 @@ public class AutomationIntegrationJsonTest extends JavaOSGiTest { waitForAssert(() -> { assertThat(itemEvent, is(notNullValue())); }, 3000, 100); - assertThat(itemEvent.getTopic(), is(equalTo("smarthome/items/myLampItem/command"))); + assertThat(itemEvent.getTopic(), is(equalTo("openhab/items/myLampItem/command"))); assertThat(((ItemCommandEvent) itemEvent).getItemCommand(), is(OnOffType.ON)); } @@ -365,7 +365,7 @@ public class AutomationIntegrationJsonTest extends JavaOSGiTest { @Override public void receive(Event e) { logger.info("Event: {}", e.getTopic()); - if ("smarthome/items/myLampItem/command".equals(e.getTopic())) { + if ("openhab/items/myLampItem/command".equals(e.getTopic())) { itemEvent = e; } } diff --git a/itests/org.openhab.core.automation.integration.tests/src/main/java/org/openhab/core/automation/integration/test/AutomationIntegrationTest.java b/itests/org.openhab.core.automation.integration.tests/src/main/java/org/openhab/core/automation/integration/test/AutomationIntegrationTest.java index b403e456a9..57c7752528 100644 --- a/itests/org.openhab.core.automation.integration.tests/src/main/java/org/openhab/core/automation/integration/test/AutomationIntegrationTest.java +++ b/itests/org.openhab.core.automation.integration.tests/src/main/java/org/openhab/core/automation/integration/test/AutomationIntegrationTest.java @@ -252,11 +252,11 @@ public class AutomationIntegrationTest extends JavaOSGiTest { logger.info("assert that a rule with connections is executed"); Map params = new HashMap<>(); params.put("eventSource", "myMotionItem3"); - params.put("eventTopic", "smarthome/*"); + params.put("eventTopic", "openhab/*"); params.put("eventTypes", "ItemStateEvent"); Configuration triggerConfig = new Configuration(params); params = new HashMap<>(); - params.put("eventTopic", "smarthome/*"); + params.put("eventTopic", "openhab/*"); Configuration condition1Config = new Configuration(params); params = new HashMap<>(); params.put("itemName", "myLampItem3"); @@ -320,11 +320,11 @@ public class AutomationIntegrationTest extends JavaOSGiTest { "assert that a rule with non existing moduleTypeHandler is added to the ruleRegistry in state UNINITIALIZED"); Map params = new HashMap<>(); params.put("eventSource", "myMotionItem"); - params.put("eventTopic", "smarthome/*"); + params.put("eventTopic", "openhab/*"); params.put("eventTypes", "ItemStateEvent"); Configuration triggerConfig = new Configuration(params); params = new HashMap<>(); - params.put("topic", "smarthome/*"); + params.put("topic", "openhab/*"); Configuration condition1Config = new Configuration(params); params = new HashMap<>(); params.put("itemName", "myLampItem3"); @@ -416,7 +416,7 @@ public class AutomationIntegrationTest extends JavaOSGiTest { waitForAssert(() -> { assertThat(itemEvent, is(notNullValue())); }, 3000, 100); - assertThat(itemEvent.getTopic(), is(equalTo("smarthome/items/myLampItem3/command"))); + assertThat(itemEvent.getTopic(), is(equalTo("openhab/items/myLampItem3/command"))); assertThat(((ItemCommandEvent) itemEvent).getItemCommand(), is(OnOffType.ON)); } @@ -624,7 +624,7 @@ public class AutomationIntegrationTest extends JavaOSGiTest { waitForAssert(() -> { assertThat(itemEvent, is(notNullValue())); }, 5000, 100); - assertThat(itemEvent.getTopic(), is(equalTo("smarthome/items/myLampItem4/command"))); + assertThat(itemEvent.getTopic(), is(equalTo("openhab/items/myLampItem4/command"))); assertThat(((ItemCommandEvent) itemEvent).getItemCommand(), is(OnOffType.ON)); } @@ -634,7 +634,7 @@ public class AutomationIntegrationTest extends JavaOSGiTest { // Creation of RULE Map params = new HashMap<>(); params.put("eventSource", "myMotionItem2"); - params.put("eventTopic", "smarthome/*"); + params.put("eventTopic", "openhab/*"); params.put("eventTypes", "ItemStateEvent"); Configuration triggerConfig = new Configuration(params); params = new HashMap<>(); @@ -738,7 +738,7 @@ public class AutomationIntegrationTest extends JavaOSGiTest { waitForAssert(() -> { assertThat(itemEvent, is(notNullValue())); }); - assertThat(itemEvent.getTopic(), is(equalTo("smarthome/items/templ_LampItem/command"))); + assertThat(itemEvent.getTopic(), is(equalTo("openhab/items/templ_LampItem/command"))); assertThat(((ItemCommandEvent) itemEvent).getItemCommand(), is(OnOffType.ON)); } @@ -798,7 +798,7 @@ public class AutomationIntegrationTest extends JavaOSGiTest { waitForAssert(() -> { assertThat(itemEvent, is(notNullValue())); }); - assertThat(itemEvent.getTopic(), is(equalTo("smarthome/items/xtempl_LampItem/command"))); + assertThat(itemEvent.getTopic(), is(equalTo("openhab/items/xtempl_LampItem/command"))); assertThat(((ItemCommandEvent) itemEvent).getItemCommand(), is(OnOffType.ON)); } @@ -905,7 +905,7 @@ public class AutomationIntegrationTest extends JavaOSGiTest { Map configs = new HashMap<>(); configs.put("eventSource", "myMotionItem2"); - configs.put("eventTopic", "smarthome/*"); + configs.put("eventTopic", "openhab/*"); configs.put("eventTypes", "ItemStateEvent"); Configuration triggerConfig = new Configuration(configs); configs = new HashMap<>(); @@ -932,7 +932,7 @@ public class AutomationIntegrationTest extends JavaOSGiTest { // Creation of RULE Map configs = new HashMap<>(); configs.put("eventSource", "myMotionItem5"); - configs.put("eventTopic", "smarthome/*"); + configs.put("eventTopic", "openhab/*"); configs.put("eventTypes", "ItemStateEvent"); Configuration triggerConfig = new Configuration(configs); configs = new HashMap<>(); @@ -1013,7 +1013,7 @@ public class AutomationIntegrationTest extends JavaOSGiTest { waitForAssert(() -> { assertThat(itemEvent, is(notNullValue())); }, 3000, 100); - assertThat(itemEvent.getTopic(), is(equalTo("smarthome/items/myLampItem5/command"))); + assertThat(itemEvent.getTopic(), is(equalTo("openhab/items/myLampItem5/command"))); assertThat(((ItemCommandEvent) itemEvent).getItemCommand(), is(OnOffType.ON)); } } diff --git a/itests/org.openhab.core.automation.integration.tests/src/main/resources/OH-INF/automation/rules/ItemRuleDefinition.json b/itests/org.openhab.core.automation.integration.tests/src/main/resources/OH-INF/automation/rules/ItemRuleDefinition.json index e9fe5f8655..2980189e94 100644 --- a/itests/org.openhab.core.automation.integration.tests/src/main/resources/OH-INF/automation/rules/ItemRuleDefinition.json +++ b/itests/org.openhab.core.automation.integration.tests/src/main/resources/OH-INF/automation/rules/ItemRuleDefinition.json @@ -18,7 +18,7 @@ "type": "core.GenericEventTrigger", "configuration": { "eventSource": "myMotionItem", - "eventTopic": "smarthome/items/*", + "eventTopic": "openhab/items/*", "eventTypes": "ItemStateEvent" } } diff --git a/itests/org.openhab.core.automation.integration.tests/src/main/resources/OH-INF/automation/templates/SimpleTestTemplate.json b/itests/org.openhab.core.automation.integration.tests/src/main/resources/OH-INF/automation/templates/SimpleTestTemplate.json index bd6561d85b..cd33cd5085 100644 --- a/itests/org.openhab.core.automation.integration.tests/src/main/resources/OH-INF/automation/templates/SimpleTestTemplate.json +++ b/itests/org.openhab.core.automation.integration.tests/src/main/resources/OH-INF/automation/templates/SimpleTestTemplate.json @@ -40,7 +40,7 @@ "type": "core.GenericEventTrigger", "configuration": { "eventSource": "${onItem}", - "eventTopic": "smarthome/items/*", + "eventTopic": "openhab/items/*", "eventTypes": "ItemStateEvent" } } diff --git a/itests/org.openhab.core.automation.integration.tests/src/main/resources/OH-INF/automation/templates/TestTemplateRuleWithReferences.json b/itests/org.openhab.core.automation.integration.tests/src/main/resources/OH-INF/automation/templates/TestTemplateRuleWithReferences.json index 2c94dfc247..514661f209 100644 --- a/itests/org.openhab.core.automation.integration.tests/src/main/resources/OH-INF/automation/templates/TestTemplateRuleWithReferences.json +++ b/itests/org.openhab.core.automation.integration.tests/src/main/resources/OH-INF/automation/templates/TestTemplateRuleWithReferences.json @@ -30,7 +30,7 @@ "type": "core.GenericEventTrigger", "configuration": { "eventSource": "${triggerItem}", - "eventTopic": "smarthome/items/*", + "eventTopic": "openhab/items/*", "eventTypes": "ItemStateEvent" } } @@ -40,7 +40,7 @@ "id": "ItemStateConditionID", "type": "core.GenericEventCondition", "configuration": { - "topic": "smarthome/items/${triggerItem}/state", + "topic": "openhab/items/${triggerItem}/state", "payload": ".*ON.*" }, "inputs": { diff --git a/itests/org.openhab.core.automation.module.core.tests/src/main/java/org/openhab/core/automation/internal/module/RunRuleModuleTest.java b/itests/org.openhab.core.automation.module.core.tests/src/main/java/org/openhab/core/automation/internal/module/RunRuleModuleTest.java index 7f72954e0f..9c4d6660cd 100644 --- a/itests/org.openhab.core.automation.module.core.tests/src/main/java/org/openhab/core/automation/internal/module/RunRuleModuleTest.java +++ b/itests/org.openhab.core.automation.module.core.tests/src/main/java/org/openhab/core/automation/internal/module/RunRuleModuleTest.java @@ -112,7 +112,7 @@ public class RunRuleModuleTest extends JavaOSGiTest { private Rule createOuterRule() { final Configuration outerRuleTriggerConfig = new Configuration(Collections.unmodifiableMap(Stream - .of(new SimpleEntry<>("eventSource", "ruleTrigger"), new SimpleEntry<>("eventTopic", "smarthome/*"), + .of(new SimpleEntry<>("eventSource", "ruleTrigger"), new SimpleEntry<>("eventTopic", "openhab/*"), new SimpleEntry<>("eventTypes", "ItemStateEvent")) .collect(Collectors.toMap((e) -> e.getKey(), (e) -> e.getValue())))); @@ -194,7 +194,7 @@ public class RunRuleModuleTest extends JavaOSGiTest { waitForAssert(() -> { assertFalse(events.isEmpty()); ItemCommandEvent event = (ItemCommandEvent) events.remove(); - assertEquals("smarthome/items/switch3/command", event.getTopic()); + assertEquals("openhab/items/switch3/command", event.getTopic()); assertEquals(OnOffType.ON, event.getItemCommand()); }); } diff --git a/itests/org.openhab.core.automation.module.core.tests/src/main/java/org/openhab/core/automation/internal/module/RuntimeRuleTest.java b/itests/org.openhab.core.automation.module.core.tests/src/main/java/org/openhab/core/automation/internal/module/RuntimeRuleTest.java index 8b11e16dff..f1bcbe30f5 100644 --- a/itests/org.openhab.core.automation.module.core.tests/src/main/java/org/openhab/core/automation/internal/module/RuntimeRuleTest.java +++ b/itests/org.openhab.core.automation.module.core.tests/src/main/java/org/openhab/core/automation/internal/module/RuntimeRuleTest.java @@ -127,7 +127,7 @@ public class RuntimeRuleTest extends JavaOSGiTest { waitForAssert(() -> { assertFalse(events.isEmpty()); ItemCommandEvent event = (ItemCommandEvent) events.remove(); - assertEquals("smarthome/items/myLampItem/command", event.getTopic()); + assertEquals("openhab/items/myLampItem/command", event.getTopic()); assertEquals(OnOffType.ON, event.getItemCommand()); }); } @@ -135,7 +135,7 @@ public class RuntimeRuleTest extends JavaOSGiTest { @Test public void itemStateUpdatedBySimpleRule() throws ItemNotFoundException, InterruptedException { final Configuration triggerConfig = new Configuration(Stream - .of(new SimpleEntry<>("eventSource", "myMotionItem2"), new SimpleEntry<>("eventTopic", "smarthome/*"), + .of(new SimpleEntry<>("eventSource", "myMotionItem2"), new SimpleEntry<>("eventTopic", "openhab/*"), new SimpleEntry<>("eventTypes", "ItemStateEvent")) .collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue()))); final Configuration actionConfig = new Configuration( @@ -190,7 +190,7 @@ public class RuntimeRuleTest extends JavaOSGiTest { waitForAssert(() -> { assertFalse(events.isEmpty()); ItemCommandEvent event = (ItemCommandEvent) events.remove(); - assertEquals("smarthome/items/myLampItem2/command", event.getTopic()); + assertEquals("openhab/items/myLampItem2/command", event.getTopic()); assertEquals(OnOffType.ON, event.getItemCommand()); }); } diff --git a/itests/org.openhab.core.automation.module.script.tests/src/main/java/org/openhab/core/automation/module/script/ScriptRuleOSGiTest.java b/itests/org.openhab.core.automation.module.script.tests/src/main/java/org/openhab/core/automation/module/script/ScriptRuleOSGiTest.java index 13fac86a35..8646a04a8e 100644 --- a/itests/org.openhab.core.automation.module.script.tests/src/main/java/org/openhab/core/automation/module/script/ScriptRuleOSGiTest.java +++ b/itests/org.openhab.core.automation.module.script.tests/src/main/java/org/openhab/core/automation/module/script/ScriptRuleOSGiTest.java @@ -131,7 +131,7 @@ public class ScriptRuleOSGiTest extends JavaOSGiTest { assertThat(trigger.isPresent(), is(true)); assertThat(trigger.get().getTypeUID(), is("core.GenericEventTrigger")); assertThat(trigger.get().getConfiguration().get("eventSource"), is("MyTrigger")); - assertThat(trigger.get().getConfiguration().get("eventTopic"), is("smarthome/items/MyTrigger/state")); + assertThat(trigger.get().getConfiguration().get("eventTopic"), is("openhab/items/MyTrigger/state")); assertThat(trigger.get().getConfiguration().get("eventTypes"), is("ItemStateEvent")); Optional condition1 = rule.getConditions().stream() .filter(c -> "condition".equals(c.getId())).findFirst(); diff --git a/itests/org.openhab.core.automation.module.script.tests/src/main/resources/OH-INF/automation/rules/DemoScriptRule.json b/itests/org.openhab.core.automation.module.script.tests/src/main/resources/OH-INF/automation/rules/DemoScriptRule.json index de6d6b07ad..04f11da357 100644 --- a/itests/org.openhab.core.automation.module.script.tests/src/main/resources/OH-INF/automation/rules/DemoScriptRule.json +++ b/itests/org.openhab.core.automation.module.script.tests/src/main/resources/OH-INF/automation/rules/DemoScriptRule.json @@ -9,7 +9,7 @@ "type": "core.GenericEventTrigger", "configuration": { "eventSource": "MyTrigger", - "eventTopic": "smarthome/items/MyTrigger/state", + "eventTopic": "openhab/items/MyTrigger/state", "eventTypes": "ItemStateEvent" } } diff --git a/itests/org.openhab.core.automation.tests/src/main/java/org/openhab/core/automation/event/RuleEventTest.java b/itests/org.openhab.core.automation.tests/src/main/java/org/openhab/core/automation/event/RuleEventTest.java index cb013a5d34..b1ce395ef0 100644 --- a/itests/org.openhab.core.automation.tests/src/main/java/org/openhab/core/automation/event/RuleEventTest.java +++ b/itests/org.openhab.core.automation.tests/src/main/java/org/openhab/core/automation/event/RuleEventTest.java @@ -134,7 +134,7 @@ public class RuleEventTest extends JavaOSGiTest { // Creation of RULE Map triggerCfgEntries = new HashMap<>(); triggerCfgEntries.put("eventSource", "myMotionItem2"); - triggerCfgEntries.put("eventTopic", "smarthome/*"); + triggerCfgEntries.put("eventTopic", "openhab/*"); triggerCfgEntries.put("eventTypes", "ItemStateEvent"); Configuration triggerConfig = new Configuration(triggerCfgEntries); @@ -194,14 +194,14 @@ public class RuleEventTest extends JavaOSGiTest { registerService(itemEventHandler); eventPublisher.post(ItemEventFactory.createStateEvent("myMotionItem2", OnOffType.ON)); waitForAssert(() -> assertThat(itemEvent, is(notNullValue()))); - assertThat(itemEvent.getTopic(), is(equalTo("smarthome/items/myLampItem2/command"))); + assertThat(itemEvent.getTopic(), is(equalTo("openhab/items/myLampItem2/command"))); assertThat(((ItemCommandEvent) itemEvent).getItemCommand(), is(OnOffType.ON)); assertThat(ruleEvents.size(), is(not(0))); - assertThat(ruleEvents.stream().filter(e -> "smarthome/rules/myRule21/added".equals(e.getTopic())).findFirst() + assertThat(ruleEvents.stream().filter(e -> "openhab/rules/myRule21/added".equals(e.getTopic())).findFirst() .isPresent(), is(true)); - assertThat(ruleEvents.stream().filter(e -> "smarthome/rules/myRule21/state".equals(e.getTopic())).findFirst() + assertThat(ruleEvents.stream().filter(e -> "openhab/rules/myRule21/state".equals(e.getTopic())).findFirst() .isPresent(), is(true)); - List stateEvents = ruleEvents.stream().filter(e -> "smarthome/rules/myRule21/state".equals(e.getTopic())) + List stateEvents = ruleEvents.stream().filter(e -> "openhab/rules/myRule21/state".equals(e.getTopic())) .collect(Collectors.toList()); assertThat(stateEvents, is(notNullValue())); Optional runningEvent = stateEvents.stream() @@ -231,7 +231,7 @@ public class RuleEventTest extends JavaOSGiTest { ruleRegistry.remove("myRule21"); waitForAssert(() -> { assertThat(ruleRemovedEvent, is(notNullValue())); - assertThat(ruleRemovedEvent.getTopic(), is(equalTo("smarthome/rules/myRule21/removed"))); + assertThat(ruleRemovedEvent.getTopic(), is(equalTo("openhab/rules/myRule21/removed"))); }); } } diff --git a/itests/org.openhab.core.tests/src/main/java/org/openhab/core/internal/events/OSGiEventManagerOSGiTest.java b/itests/org.openhab.core.tests/src/main/java/org/openhab/core/internal/events/OSGiEventManagerOSGiTest.java index 0d5381ed3b..3c89b772cf 100644 --- a/itests/org.openhab.core.tests/src/main/java/org/openhab/core/internal/events/OSGiEventManagerOSGiTest.java +++ b/itests/org.openhab.core.tests/src/main/java/org/openhab/core/internal/events/OSGiEventManagerOSGiTest.java @@ -51,7 +51,7 @@ public class OSGiEventManagerOSGiTest extends JavaOSGiTest { private static final String EVENT_TYPE_FACTORY_A_B = "EVENT_TYPE_FACTORY_A_B"; private static final String EVENT_TYPE_FACTORY_C = "EVENT_TYPE_FACTORY_C"; - private static final String TOPIC = "smarthome/some/topic"; + private static final String TOPIC = "openhab/some/topic"; private static final String TYPE_BASED_SUBSCRIBER_1 = "TYPE_BASED_SUBSCRIBER_1"; private static final String TYPE_BASED_SUBSCRIBER_2 = "TYPE_BASED_SUBSCRIBER_2"; diff --git a/itests/org.openhab.core.tests/src/main/java/org/openhab/core/items/GroupItemOSGiTest.java b/itests/org.openhab.core.tests/src/main/java/org/openhab/core/items/GroupItemOSGiTest.java index 5156bf93aa..296c9ec0d0 100644 --- a/itests/org.openhab.core.tests/src/main/java/org/openhab/core/items/GroupItemOSGiTest.java +++ b/itests/org.openhab.core.tests/src/main/java/org/openhab/core/items/GroupItemOSGiTest.java @@ -433,7 +433,7 @@ public class GroupItemOSGiTest extends JavaOSGiTest { @Test public void assertThatGroupItemPostsEventsForChangesCorrectly() { // from ItemEventFactory.GROUPITEM_STATE_CHANGED_EVENT_TOPIC - String groupitemStateChangedEventTopic = "smarthome/items/{itemName}/{memberName}/statechanged"; + String groupitemStateChangedEventTopic = "openhab/items/{itemName}/{memberName}/statechanged"; events.clear(); GroupItem groupItem = new GroupItem("root", new SwitchItem("mySwitch"), new GroupFunction.Equality()); diff --git a/itests/org.openhab.core.tests/src/main/java/org/openhab/core/items/events/AbstractItemEventSubscriberOSGiTest.java b/itests/org.openhab.core.tests/src/main/java/org/openhab/core/items/events/AbstractItemEventSubscriberOSGiTest.java index cd5a5a69e4..cfbdad6e18 100644 --- a/itests/org.openhab.core.tests/src/main/java/org/openhab/core/items/events/AbstractItemEventSubscriberOSGiTest.java +++ b/itests/org.openhab.core.tests/src/main/java/org/openhab/core/items/events/AbstractItemEventSubscriberOSGiTest.java @@ -144,7 +144,7 @@ public class AbstractItemEventSubscriberOSGiTest extends JavaOSGiTest { @Override public String getTopic() { - return "smarthome/items"; + return "openhab/items"; } @Override diff --git a/itests/org.openhab.core.thing.tests/src/main/java/org/openhab/core/thing/binding/BindingBaseClassesOSGiTest.java b/itests/org.openhab.core.thing.tests/src/main/java/org/openhab/core/thing/binding/BindingBaseClassesOSGiTest.java index bfb0c8dea9..7aa2bdc69e 100644 --- a/itests/org.openhab.core.thing.tests/src/main/java/org/openhab/core/thing/binding/BindingBaseClassesOSGiTest.java +++ b/itests/org.openhab.core.thing.tests/src/main/java/org/openhab/core/thing/binding/BindingBaseClassesOSGiTest.java @@ -262,7 +262,7 @@ public class BindingBaseClassesOSGiTest extends JavaOSGiTest { @Override public boolean apply(Event event) { return event.getTopic().equals( - "smarthome/things/{thingUID}/config/status".replace("{thingUID}", thingUID.getAsString())); + "openhab/things/{thingUID}/config/status".replace("{thingUID}", thingUID.getAsString())); }; }; } diff --git a/itests/org.openhab.core.thing.tests/src/main/java/org/openhab/core/thing/internal/ThingManagerOSGiTest.java b/itests/org.openhab.core.thing.tests/src/main/java/org/openhab/core/thing/internal/ThingManagerOSGiTest.java index eeae65df95..0d69e8b5ae 100644 --- a/itests/org.openhab.core.thing.tests/src/main/java/org/openhab/core/thing/internal/ThingManagerOSGiTest.java +++ b/itests/org.openhab.core.thing.tests/src/main/java/org/openhab/core/thing/internal/ThingManagerOSGiTest.java @@ -877,7 +877,7 @@ public class ThingManagerOSGiTest extends JavaOSGiTest { @Override public @Nullable EventFilter getEventFilter() { - return new TopicEventFilter("smarthome/items/.*/state"); + return new TopicEventFilter("openhab/items/.*/state"); } }; registerService(itemUpdateEventSubscriber); @@ -887,7 +887,7 @@ public class ThingManagerOSGiTest extends JavaOSGiTest { waitForAssert(() -> assertThat(receivedEvents.size(), is(1))); assertThat(receivedEvents.get(0), is(instanceOf(ItemStateEvent.class))); ItemStateEvent itemUpdateEvent = (ItemStateEvent) receivedEvents.get(0); - assertThat(itemUpdateEvent.getTopic(), is("smarthome/items/name/state")); + assertThat(itemUpdateEvent.getTopic(), is("openhab/items/name/state")); assertThat(itemUpdateEvent.getItemName(), is(itemName)); assertThat(itemUpdateEvent.getSource(), is(CHANNEL_UID.toString())); assertThat(itemUpdateEvent.getItemState(), is(instanceOf(StringType.class))); @@ -903,7 +903,7 @@ public class ThingManagerOSGiTest extends JavaOSGiTest { assertThat(receivedEvents.get(0), is(instanceOf(ItemStateEvent.class))); itemUpdateEvent = (ItemStateEvent) receivedEvents.get(0); - assertThat(itemUpdateEvent.getTopic(), is("smarthome/items/name/state")); + assertThat(itemUpdateEvent.getTopic(), is("openhab/items/name/state")); assertThat(itemUpdateEvent.getItemName(), is(itemName)); assertThat(itemUpdateEvent.getSource(), is(CHANNEL_UID.toString())); assertThat(itemUpdateEvent.getItemState(), is(instanceOf(StringType.class))); @@ -1257,7 +1257,7 @@ public class ThingManagerOSGiTest extends JavaOSGiTest { waitForAssert(() -> assertThat(infoChangedEvents.size(), is(1))); assertThat(infoChangedEvents.get(0).getType(), is(ThingStatusInfoChangedEvent.TYPE)); - assertThat(infoChangedEvents.get(0).getTopic(), is("smarthome/things/binding:type:id/statuschanged")); + assertThat(infoChangedEvents.get(0).getTopic(), is("openhab/things/binding:type:id/statuschanged")); assertThat(infoChangedEvents.get(0).getStatusInfo().getStatus(), is(ThingStatus.INITIALIZING)); assertThat(infoChangedEvents.get(0).getOldStatusInfo().getStatus(), is(ThingStatus.UNINITIALIZED)); infoChangedEvents.clear(); @@ -1268,7 +1268,7 @@ public class ThingManagerOSGiTest extends JavaOSGiTest { waitForAssert(() -> assertThat(infoChangedEvents.size(), is(1))); assertThat(infoChangedEvents.get(0).getType(), is(ThingStatusInfoChangedEvent.TYPE)); - assertThat(infoChangedEvents.get(0).getTopic(), is("smarthome/things/binding:type:id/statuschanged")); + assertThat(infoChangedEvents.get(0).getTopic(), is("openhab/things/binding:type:id/statuschanged")); assertThat(infoChangedEvents.get(0).getStatusInfo().getStatus(), is(ThingStatus.ONLINE)); assertThat(infoChangedEvents.get(0).getOldStatusInfo().getStatus(), is(ThingStatus.INITIALIZING)); infoChangedEvents.clear(); @@ -1362,13 +1362,13 @@ public class ThingManagerOSGiTest extends JavaOSGiTest { }); assertThat(infoEvents.get(0).getType(), is(ThingStatusInfoEvent.TYPE)); - assertThat(infoEvents.get(0).getTopic(), is("smarthome/things/binding:type:id/status")); + assertThat(infoEvents.get(0).getTopic(), is("openhab/things/binding:type:id/status")); assertThat(infoEvents.get(0).getStatusInfo().getStatus(), is(ThingStatus.INITIALIZING)); assertThat(infoEvents.get(0).getStatusInfo().getStatusDetail(), is(ThingStatusDetail.NONE)); assertThat(infoEvents.get(0).getStatusInfo().getDescription(), is(nullValue())); assertThat(infoChangedEvents.get(0).getType(), is(ThingStatusInfoChangedEvent.TYPE)); - assertThat(infoChangedEvents.get(0).getTopic(), is("smarthome/things/binding:type:id/statuschanged")); + assertThat(infoChangedEvents.get(0).getTopic(), is("openhab/things/binding:type:id/statuschanged")); assertThat(infoChangedEvents.get(0).getStatusInfo().getStatus(), is(ThingStatus.INITIALIZING)); assertThat(infoChangedEvents.get(0).getStatusInfo().getStatusDetail(), is(ThingStatusDetail.NONE)); assertThat(infoChangedEvents.get(0).getStatusInfo().getDescription(), is(nullValue())); @@ -1397,13 +1397,13 @@ public class ThingManagerOSGiTest extends JavaOSGiTest { }); assertThat(infoEvents.get(0).getType(), is(ThingStatusInfoEvent.TYPE)); - assertThat(infoEvents.get(0).getTopic(), is("smarthome/things/binding:type:id/status")); + assertThat(infoEvents.get(0).getTopic(), is("openhab/things/binding:type:id/status")); assertThat(infoEvents.get(0).getStatusInfo().getStatus(), is(ThingStatus.ONLINE)); assertThat(infoEvents.get(0).getStatusInfo().getStatusDetail(), is(ThingStatusDetail.NONE)); assertThat(infoEvents.get(0).getStatusInfo().getDescription(), is("Thing is online.")); assertThat(infoChangedEvents.get(0).getType(), is(ThingStatusInfoChangedEvent.TYPE)); - assertThat(infoChangedEvents.get(0).getTopic(), is("smarthome/things/binding:type:id/statuschanged")); + assertThat(infoChangedEvents.get(0).getTopic(), is("openhab/things/binding:type:id/statuschanged")); assertThat(infoChangedEvents.get(0).getStatusInfo().getStatus(), is(ThingStatus.ONLINE)); assertThat(infoChangedEvents.get(0).getStatusInfo().getStatusDetail(), is(ThingStatusDetail.NONE)); assertThat(infoChangedEvents.get(0).getStatusInfo().getDescription(), is("Thing is online.")); @@ -1428,13 +1428,13 @@ public class ThingManagerOSGiTest extends JavaOSGiTest { }); assertThat(infoEvents.get(0).getType(), is(ThingStatusInfoEvent.TYPE)); - assertThat(infoEvents.get(0).getTopic(), is("smarthome/things/binding:type:id/status")); + assertThat(infoEvents.get(0).getTopic(), is("openhab/things/binding:type:id/status")); assertThat(infoEvents.get(0).getStatusInfo().getStatus(), is(ThingStatus.OFFLINE)); assertThat(infoEvents.get(0).getStatusInfo().getStatusDetail(), is(ThingStatusDetail.NONE)); assertThat(infoEvents.get(0).getStatusInfo().getDescription(), is("Thing ist offline.")); assertThat(infoChangedEvents.get(0).getType(), is(ThingStatusInfoChangedEvent.TYPE)); - assertThat(infoChangedEvents.get(0).getTopic(), is("smarthome/things/binding:type:id/statuschanged")); + assertThat(infoChangedEvents.get(0).getTopic(), is("openhab/things/binding:type:id/statuschanged")); assertThat(infoChangedEvents.get(0).getStatusInfo().getStatus(), is(ThingStatus.OFFLINE)); assertThat(infoChangedEvents.get(0).getStatusInfo().getStatusDetail(), is(ThingStatusDetail.NONE)); assertThat(infoChangedEvents.get(0).getStatusInfo().getDescription(), is("Thing ist offline.")); diff --git a/itests/org.openhab.core.thing.tests/src/main/java/org/openhab/core/thing/link/LinkEventOSGiTest.java b/itests/org.openhab.core.thing.tests/src/main/java/org/openhab/core/thing/link/LinkEventOSGiTest.java index 027d157e50..c74efeaa76 100644 --- a/itests/org.openhab.core.thing.tests/src/main/java/org/openhab/core/thing/link/LinkEventOSGiTest.java +++ b/itests/org.openhab.core.thing.tests/src/main/java/org/openhab/core/thing/link/LinkEventOSGiTest.java @@ -82,11 +82,11 @@ public class LinkEventOSGiTest extends JavaOSGiTest { waitFor(() -> eventSubscriber.getLastReceivedEvent() != null); waitForAssert( () -> assertThat(eventSubscriber.getLastReceivedEvent().getType(), is(ItemChannelLinkAddedEvent.TYPE))); - assertThat(eventSubscriber.getLastReceivedEvent().getTopic(), is("smarthome/links/item-a:b:c:d/added")); + assertThat(eventSubscriber.getLastReceivedEvent().getTopic(), is("openhab/links/item-a:b:c:d/added")); itemChannelLinkRegistry.remove(link.getUID()); waitForAssert(() -> assertThat(eventSubscriber.getLastReceivedEvent().getType(), is(ItemChannelLinkRemovedEvent.TYPE))); - assertThat(eventSubscriber.getLastReceivedEvent().getTopic(), is("smarthome/links/item-a:b:c:d/removed")); + assertThat(eventSubscriber.getLastReceivedEvent().getTopic(), is("openhab/links/item-a:b:c:d/removed")); } }