Adapt to core changes (addon.xml) (#13289)
Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
@@ -27,7 +27,7 @@ import javax.ws.rs.client.ClientBuilder;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.core.binding.BindingInfoRegistry;
|
||||
import org.openhab.core.addon.AddonInfoRegistry;
|
||||
import org.openhab.core.config.core.ConfigurableService;
|
||||
import org.openhab.core.events.Event;
|
||||
import org.openhab.core.events.EventFilter;
|
||||
@@ -87,7 +87,7 @@ public class NeeoService implements EventSubscriber, NetworkAddressChangeListene
|
||||
// The following services are set by openHAB via the getter/setters
|
||||
private final HttpService httpService;
|
||||
private final ItemRegistry itemRegistry;
|
||||
private final BindingInfoRegistry bindingInfoRegistry;
|
||||
private final AddonInfoRegistry bindingInfoRegistry;
|
||||
private final ThingRegistry thingRegistry;
|
||||
private final ThingTypeRegistry thingTypeRegistry;
|
||||
private final ItemChannelLinkRegistry itemChannelLinkRegistry;
|
||||
@@ -140,13 +140,13 @@ public class NeeoService implements EventSubscriber, NetworkAddressChangeListene
|
||||
@Activate
|
||||
public NeeoService(ComponentContext componentContext, @Reference HttpService httpService,
|
||||
@Reference ItemRegistry itemRegistry, @Reference ThingRegistry thingRegistry,
|
||||
@Reference BindingInfoRegistry bindingInfoRegistry, @Reference ChannelTypeRegistry channelTypeRegistry,
|
||||
@Reference AddonInfoRegistry addonInfoRegistry, @Reference ChannelTypeRegistry channelTypeRegistry,
|
||||
@Reference ThingTypeRegistry thingTypeRegistry, @Reference ItemChannelLinkRegistry itemChannelLinkRegistry,
|
||||
@Reference MDNSClient mdnsClient, @Reference EventPublisher eventPublisher,
|
||||
@Reference NetworkAddressService networkAddressService, @Reference ClientBuilder clientBuilder) {
|
||||
this.httpService = httpService;
|
||||
this.itemRegistry = itemRegistry;
|
||||
this.bindingInfoRegistry = bindingInfoRegistry;
|
||||
this.bindingInfoRegistry = addonInfoRegistry;
|
||||
this.channelTypeRegistry = channelTypeRegistry;
|
||||
this.thingRegistry = thingRegistry;
|
||||
this.thingTypeRegistry = thingTypeRegistry;
|
||||
@@ -158,7 +158,7 @@ public class NeeoService implements EventSubscriber, NetworkAddressChangeListene
|
||||
|
||||
logger.debug("Neeo Service activated");
|
||||
final ServiceContext localContext = new ServiceContext(componentContext, validate(httpService, "httpService"),
|
||||
validate(itemRegistry, "itemRegistry"), validate(bindingInfoRegistry, "bindingInfoRegistry"),
|
||||
validate(itemRegistry, "itemRegistry"), validate(addonInfoRegistry, "addonInfoRegistry"),
|
||||
validate(thingRegistry, "thingRegistry"), validate(thingTypeRegistry, "thingTypeRegistry"),
|
||||
validate(itemChannelLinkRegistry, "itemChannelLinkRegistry"),
|
||||
validate(channelTypeRegistry, "channelTypeRegistry"), validate(mdnsClient, "mdnsClient"),
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.UUID;
|
||||
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.openhab.core.binding.BindingInfoRegistry;
|
||||
import org.openhab.core.addon.AddonInfoRegistry;
|
||||
import org.openhab.core.events.EventPublisher;
|
||||
import org.openhab.core.io.transport.mdns.MDNSClient;
|
||||
import org.openhab.core.items.ItemRegistry;
|
||||
@@ -48,7 +48,7 @@ public class ServiceContext {
|
||||
private final ItemRegistry itemRegistry;
|
||||
|
||||
/** The binding info registry. */
|
||||
private final BindingInfoRegistry bindingInfoRegistry;
|
||||
private final AddonInfoRegistry addonInfoRegistry;
|
||||
|
||||
/** The thing registry. */
|
||||
private final ThingRegistry thingRegistry;
|
||||
@@ -80,7 +80,7 @@ public class ServiceContext {
|
||||
* @param componentContext a non-null component context
|
||||
* @param httpService a non-null http service
|
||||
* @param itemRegistry a non-null item registry
|
||||
* @param bindingInfoRegistry a non-null binding information registry
|
||||
* @param addonInfoRegistry a non-null addon information registry
|
||||
* @param thingRegistry a non-null thing registry
|
||||
* @param thingTypeRegistry a non-null thing type registry
|
||||
* @param itemChannelLinkRegistry a non-null item channel link registry
|
||||
@@ -90,13 +90,13 @@ public class ServiceContext {
|
||||
* @param networkAddressService a non-null network address service
|
||||
*/
|
||||
public ServiceContext(ComponentContext componentContext, HttpService httpService, ItemRegistry itemRegistry,
|
||||
BindingInfoRegistry bindingInfoRegistry, ThingRegistry thingRegistry, ThingTypeRegistry thingTypeRegistry,
|
||||
AddonInfoRegistry addonInfoRegistry, ThingRegistry thingRegistry, ThingTypeRegistry thingTypeRegistry,
|
||||
ItemChannelLinkRegistry itemChannelLinkRegistry, ChannelTypeRegistry channelTypeRegistry,
|
||||
MDNSClient mdnsClient, EventPublisher eventPublisher, NetworkAddressService networkAddressService) {
|
||||
Objects.requireNonNull(componentContext, "componentContext cannot be null");
|
||||
Objects.requireNonNull(httpService, "httpService cannot be null");
|
||||
Objects.requireNonNull(itemRegistry, "itemRegistry cannot be null");
|
||||
Objects.requireNonNull(bindingInfoRegistry, "bindingInfoRegistry cannot be null");
|
||||
Objects.requireNonNull(addonInfoRegistry, "addonInfoRegistry cannot be null");
|
||||
Objects.requireNonNull(thingRegistry, "thingRegistry cannot be null");
|
||||
Objects.requireNonNull(thingTypeRegistry, "thingTypeRegistry cannot be null");
|
||||
Objects.requireNonNull(itemChannelLinkRegistry, "itemChannelLinkRegistry cannot be null");
|
||||
@@ -108,7 +108,7 @@ public class ServiceContext {
|
||||
this.componentContext = componentContext;
|
||||
this.httpService = httpService;
|
||||
this.itemRegistry = itemRegistry;
|
||||
this.bindingInfoRegistry = bindingInfoRegistry;
|
||||
this.addonInfoRegistry = addonInfoRegistry;
|
||||
this.thingRegistry = thingRegistry;
|
||||
this.thingTypeRegistry = thingTypeRegistry;
|
||||
this.itemChannelLinkRegistry = itemChannelLinkRegistry;
|
||||
@@ -160,8 +160,8 @@ public class ServiceContext {
|
||||
*
|
||||
* @return the binding info registry
|
||||
*/
|
||||
public BindingInfoRegistry getBindingInfoRegistry() {
|
||||
return bindingInfoRegistry;
|
||||
public AddonInfoRegistry getAddonInfoRegistry() {
|
||||
return addonInfoRegistry;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.stream.Collectors;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.jdt.annotation.NonNull;
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.openhab.core.binding.BindingInfo;
|
||||
import org.openhab.core.addon.AddonInfo;
|
||||
import org.openhab.core.thing.Thing;
|
||||
import org.openhab.core.thing.type.ThingType;
|
||||
import org.openhab.io.neeo.internal.models.NeeoDevice;
|
||||
@@ -118,7 +118,7 @@ public class TokenSearch {
|
||||
if (tt != null) {
|
||||
score += search(tt.getLabel(), needles);
|
||||
|
||||
final BindingInfo bi = context.getBindingInfoRegistry().getBindingInfo(tt.getBindingId());
|
||||
final AddonInfo bi = context.getAddonInfoRegistry().getAddonInfo(tt.getBindingId());
|
||||
if (bi != null) {
|
||||
score += search(bi.getName(), needles);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<addon:addon id="neeo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:addon="https://openhab.org/schemas/addon/v1.0.0"
|
||||
xsi:schemaLocation="https://openhab.org/schemas/addon/v1.0.0 https://openhab.org/schemas/addon-1.0.0.xsd">
|
||||
|
||||
<type>misc</type>
|
||||
<name>Neeo</name>
|
||||
<description>An additional REST endpoint to retrieve openHAB core metrics.</description>
|
||||
|
||||
<service-id>org.openhab.io.neeo.NeeoService</service-id>
|
||||
|
||||
<config-description-ref uri="io.neeo"/>
|
||||
|
||||
</addon:addon>
|
||||
Reference in New Issue
Block a user