From 4549915a0262df8abb0d986953fff7a6332a1622 Mon Sep 17 00:00:00 2001 From: Laurent ARNAL Date: Fri, 6 Dec 2024 16:09:29 +0100 Subject: [PATCH] spotless::apply Signed-off-by: Laurent ARNAL --- .../internal/SmartthingsServlet.java | 5 +--- .../internal/api/SmartthingsApi.java | 7 +---- .../api/SmartthingsNetworkConnector.java | 1 - .../api/SmartthingsNetworkConnectorImpl.java | 1 - .../SmartthingsDiscoveryService.java | 7 ++--- .../handler/SmartthingsBridgeHandler.java | 2 -- .../SmartthingsCloudBridgeHandler.java | 1 - .../type/SmartthingsJSonAttributes.java | 1 - .../type/SmartthingsJSonCapabilities.java | 1 - .../type/SmartthingsJSonProperties.java | 1 - .../internal/type/SmartthingsJSonSchema.java | 1 - .../SmartthingsThingTypeProviderImpl.java | 1 - .../type/SmartthingsTypeRegistryImpl.java | 6 ---- .../resources/OH-INF/thing/thing-types.xml | 30 +++++++++---------- 14 files changed, 20 insertions(+), 45 deletions(-) diff --git a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/SmartthingsServlet.java b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/SmartthingsServlet.java index 935a3b2b04cab..c086c747f7b1c 100644 --- a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/SmartthingsServlet.java +++ b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/SmartthingsServlet.java @@ -34,8 +34,6 @@ import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; import org.osgi.service.component.annotations.Activate; -import org.osgi.service.component.annotations.Component; -import org.osgi.service.component.annotations.Deactivate; import org.osgi.service.component.annotations.Reference; import org.osgi.service.event.Event; import org.osgi.service.event.EventAdmin; @@ -64,7 +62,7 @@ public SmartthingsServlet(HttpService httpService) { this.httpService = httpService; } - @Activate + @Activate public void activate() { if (httpService == null) { logger.info("SmartthingsServlet.activate: httpService is unexpectedly null"); @@ -97,7 +95,6 @@ public void init(@Nullable ServletConfig servletConfig) throws ServletException logger.info("SmartthingsServlet:init"); ServletContext context = servletConfig.getServletContext(); BundleContext bundleContext = (BundleContext) context.getAttribute("osgi-bundlecontext"); - } @Reference diff --git a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/api/SmartthingsApi.java b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/api/SmartthingsApi.java index 903944257966a..6b6d7f5579c94 100644 --- a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/api/SmartthingsApi.java +++ b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/api/SmartthingsApi.java @@ -60,7 +60,6 @@ public JsonArray GetAllDevices() { JsonElement res1 = ((JsonObject) result).get("items"); JsonArray devices = res1.getAsJsonArray(); return devices; - } public void SendCommand(String deviceId, String jsonMsg) { @@ -82,7 +81,6 @@ public void SendCommand(String deviceId, String jsonMsg) { } catch (OAuthException | OAuthResponseException e) { throw new RuntimeException(e.getMessage(), e); } - } public @Nullable JsonObject SendStatus(String deviceId, String jsonMsg) { @@ -105,7 +103,6 @@ public void SendCommand(String deviceId, String jsonMsg) { } catch (OAuthException | OAuthResponseException e) { throw new RuntimeException(e.getMessage(), e); } - } private @Nullable JsonElement DoRequest(String uri) { @@ -126,7 +123,6 @@ public void SendCommand(String deviceId, String jsonMsg) { } catch (OAuthException | OAuthResponseException e) { throw new RuntimeException(e.getMessage(), e); } - } /** @@ -162,5 +158,4 @@ public void SendCommand(String deviceId, String jsonMsg) { * } * } */ - -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/api/SmartthingsNetworkConnector.java b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/api/SmartthingsNetworkConnector.java index cafe302011872..5942d97a1c4d1 100644 --- a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/api/SmartthingsNetworkConnector.java +++ b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/api/SmartthingsNetworkConnector.java @@ -35,5 +35,4 @@ public interface SmartthingsNetworkConnector { public void onComplete(Request request); public void onError(Request request, SmartthingsNetworkCallback cb) throws Exception; - } diff --git a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/api/SmartthingsNetworkConnectorImpl.java b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/api/SmartthingsNetworkConnectorImpl.java index 1bf65c7e6f383..fddde5a2f609c 100644 --- a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/api/SmartthingsNetworkConnectorImpl.java +++ b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/api/SmartthingsNetworkConnectorImpl.java @@ -309,5 +309,4 @@ public static Gson getGson() { * return gsonWithAdpter; * } */ - } diff --git a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/discovery/SmartthingsDiscoveryService.java b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/discovery/SmartthingsDiscoveryService.java index f473e08c40383..d3340352cbf52 100644 --- a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/discovery/SmartthingsDiscoveryService.java +++ b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/discovery/SmartthingsDiscoveryService.java @@ -204,9 +204,9 @@ public void startScan() { enabled = true; } - //if (!enabled) { - // continue; - //} + // if (!enabled) { + // continue; + // } JsonArray componentsArray = (JsonArray) components; @@ -383,5 +383,4 @@ public void handleEvent(@Nullable Event event) { createDevice(Objects.requireNonNull(deviceData)); } } - } diff --git a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/handler/SmartthingsBridgeHandler.java b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/handler/SmartthingsBridgeHandler.java index 08dcf94dcfb79..ab1567df73670 100644 --- a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/handler/SmartthingsBridgeHandler.java +++ b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/handler/SmartthingsBridgeHandler.java @@ -118,7 +118,6 @@ public void initialize() { @Override public void onAccessTokenResponse(AccessTokenResponse tokenResponse) { - } public SmartthingsApi getSmartthingsApi() { @@ -156,7 +155,6 @@ public boolean isAuthorized() { return accessTokenResponse != null && accessTokenResponse.getAccessToken() != null && accessTokenResponse.getRefreshToken() != null; - } private @Nullable AccessTokenResponse getAccessTokenResponse() { diff --git a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/handler/SmartthingsCloudBridgeHandler.java b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/handler/SmartthingsCloudBridgeHandler.java index daf0fa4fac291..0ce9958d85842 100644 --- a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/handler/SmartthingsCloudBridgeHandler.java +++ b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/handler/SmartthingsCloudBridgeHandler.java @@ -104,5 +104,4 @@ public Collection getConfigStatus() { return configStatusMessages; } - } diff --git a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsJSonAttributes.java b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsJSonAttributes.java index 913e2b4f494f7..2a9b417f98462 100644 --- a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsJSonAttributes.java +++ b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsJSonAttributes.java @@ -32,5 +32,4 @@ public SmartthingsJSonSchema getSchema() { public void setSchema(SmartthingsJSonSchema value) { schema = value; } - } diff --git a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsJSonCapabilities.java b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsJSonCapabilities.java index a6fb72af01407..528949bc98fd5 100644 --- a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsJSonCapabilities.java +++ b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsJSonCapabilities.java @@ -71,5 +71,4 @@ public List getCommands() { public void setCommands(List value) { commands = value; } - } diff --git a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsJSonProperties.java b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsJSonProperties.java index f22260adb9952..f107972a49548 100644 --- a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsJSonProperties.java +++ b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsJSonProperties.java @@ -32,5 +32,4 @@ public void setTitle(String value) { public String getTitle() { return title; } - } diff --git a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsJSonSchema.java b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsJSonSchema.java index 6ed5e68bd0842..10f8f8b180e2f 100644 --- a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsJSonSchema.java +++ b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsJSonSchema.java @@ -43,5 +43,4 @@ public String getTitle() { public void setTitle(String value) { title = value; } - } diff --git a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsThingTypeProviderImpl.java b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsThingTypeProviderImpl.java index 5cc1303067e20..4ac829088d1a4 100644 --- a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsThingTypeProviderImpl.java +++ b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsThingTypeProviderImpl.java @@ -58,5 +58,4 @@ public Collection getThingTypes(@Nullable Locale locale) { public @Nullable ThingType getThingType(ThingTypeUID thingTypeUID, @Nullable Locale locale) { return thingTypesByUID.get(thingTypeUID); } - } diff --git a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsTypeRegistryImpl.java b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsTypeRegistryImpl.java index 43969b3a1ae01..b070783f1b48f 100644 --- a/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsTypeRegistryImpl.java +++ b/bundles/org.openhab.binding.smartthings/src/main/java/org/openhab/binding/smartthings/internal/type/SmartthingsTypeRegistryImpl.java @@ -111,7 +111,6 @@ public SmartthingsTypeRegistryImpl() { loadCapabilitiesDefs(); logger.info("pa"); - } class SmartthingsAttributesDeserializer implements JsonDeserializer> { @@ -251,7 +250,6 @@ public void loadCapabilityDef(String path) { logger.info("error loading capa:" + path + " <> " + ex); logger.info(""); } - } public Gson getGson() { @@ -261,7 +259,6 @@ public Gson getGson() { @Override public void initialize() { // TODO Auto-generated method stub - } @Reference @@ -324,7 +321,6 @@ private String readTemplate(String templateName) throws IOException { @Override public void Register(SmartthingsDeviceData deviceData, JsonObject devObj) { generateThingsType(deviceData.id, deviceData.label, deviceData.deviceType, deviceData.description, devObj); - } private void generateThingsType(String deviceId, String deviceLabel, String deviceType, String deviceDescription, @@ -440,7 +436,6 @@ private ChannelType createChannelType(String itemType, ChannelTypeUID channelTyp .build(); return channelType; - } /** @@ -492,5 +487,4 @@ private void generateConfigDescription(String device, List gro .withParameters(parms).withParameterGroups(groups).build()); } } - } diff --git a/bundles/org.openhab.binding.smartthings/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.smartthings/src/main/resources/OH-INF/thing/thing-types.xml index 20597535b9056..8b5ad927d16a5 100644 --- a/bundles/org.openhab.binding.smartthings/src/main/resources/OH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.smartthings/src/main/resources/OH-INF/thing/thing-types.xml @@ -5,21 +5,21 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> - - - Smartthings Cloud Hub + + + Smartthings Cloud Hub - - - - The apps oauth client Id - - - - The apps oauth client Secret - - - + + + + The apps oauth client Id + + + + The apps oauth client Secret + + + Smartthings Hub V2 that is attached to the same network @@ -38,6 +38,6 @@ - +