diff --git a/CODEOWNERS b/CODEOWNERS
index 58bf402a9a6c0..1235d7f6a04d6 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -2,7 +2,7 @@
# It should always list the active maintainers of certain add-ons.
# As a fallback, if no specific maintainer is listed below, assign the PR to the repo maintainers team:
-* @openhab/2-x-add-ons-maintainers
+* @openhab/add-ons-maintainers
# Add-on maintainers:
/bundles/org.openhab.binding.adorne/ @theiding
@@ -41,10 +41,12 @@
/bundles/org.openhab.binding.doorbird/ @mhilbush
/bundles/org.openhab.binding.dscalarm/ @RSStephens
/bundles/org.openhab.binding.dsmr/ @Hilbrand
+/bundles/org.openhab.binding.dwdpollenflug/ @DerOetzi
/bundles/org.openhab.binding.dwdunwetter/ @limdul79
/bundles/org.openhab.binding.elerotransmitterstick/ @vbier
/bundles/org.openhab.binding.enocean/ @fruggy83
/bundles/org.openhab.binding.enturno/ @klocsson
+/bundles/org.openhab.binding.etherrain/ @dfad1469
/bundles/org.openhab.binding.evohome/ @Nebula83
/bundles/org.openhab.binding.exec/ @kgoderis
/bundles/org.openhab.binding.feed/ @svilenvul
@@ -154,6 +156,7 @@
/bundles/org.openhab.binding.rotel/ @lolodomo
/bundles/org.openhab.binding.rotelra1x/ @fa2k
/bundles/org.openhab.binding.russound/ @tmrobert8
+/bundles/org.openhab.binding.sagercaster/ @clinique
/bundles/org.openhab.binding.samsungtv/ @paulianttila
/bundles/org.openhab.binding.satel/ @druciak
/bundles/org.openhab.binding.seneye/ @nikotanghe
@@ -216,15 +219,15 @@
/bundles/org.openhab.io.transport.modbus/ @ssalonen
/bundles/org.openhab.io.webaudio/ @kaikreuzer
/bundles/org.openhab.persistence.mapdb/ @mkhl
-/bundles/org.openhab.transform.exec/ @openhab/2-x-add-ons-maintainers
-/bundles/org.openhab.transform.javascript/ @openhab/2-x-add-ons-maintainers
+/bundles/org.openhab.transform.exec/ @openhab/add-ons-maintainers
+/bundles/org.openhab.transform.javascript/ @openhab/add-ons-maintainers
/bundles/org.openhab.transform.jinja/ @jochen314
/bundles/org.openhab.transform.jsonpath/ @clinique
-/bundles/org.openhab.transform.map/ @openhab/2-x-add-ons-maintainers
-/bundles/org.openhab.transform.regex/ @openhab/2-x-add-ons-maintainers
+/bundles/org.openhab.transform.map/ @openhab/add-ons-maintainers
+/bundles/org.openhab.transform.regex/ @openhab/add-ons-maintainers
/bundles/org.openhab.transform.scale/ @clinique
-/bundles/org.openhab.transform.xpath/ @openhab/2-x-add-ons-maintainers
-/bundles/org.openhab.transform.xslt/ @openhab/2-x-add-ons-maintainers
+/bundles/org.openhab.transform.xpath/ @openhab/add-ons-maintainers
+/bundles/org.openhab.transform.xslt/ @openhab/add-ons-maintainers
/bundles/org.openhab.voice.googletts/ @gbicskei
/bundles/org.openhab.voice.mactts/ @kaikreuzer
/bundles/org.openhab.voice.marytts/ @kaikreuzer
diff --git a/bom/openhab-addons/pom.xml b/bom/openhab-addons/pom.xml
index 00421d5781da4..c45ec6f489247 100644
--- a/bom/openhab-addons/pom.xml
+++ b/bom/openhab-addons/pom.xml
@@ -194,6 +194,11 @@
org.openhab.binding.dsmr
${project.version}
+
+ org.openhab.addons.bundles
+ org.openhab.binding.dwdpollenflug
+ ${project.version}
+
org.openhab.addons.bundles
org.openhab.binding.dwdunwetter
@@ -214,6 +219,11 @@
org.openhab.binding.enturno
${project.version}
+
+ org.openhab.addons.bundles
+ org.openhab.binding.etherrain
+ ${project.version}
+
org.openhab.addons.bundles
org.openhab.binding.evohome
@@ -764,6 +774,11 @@
org.openhab.binding.russound
${project.version}
+
+ org.openhab.addons.bundles
+ org.openhab.binding.sagercaster
+ ${project.version}
+
org.openhab.addons.bundles
org.openhab.binding.samsungtv
diff --git a/bundles/org.openhab.binding.adorne/.classpath b/bundles/org.openhab.binding.adorne/.classpath
index a5d95095ccaaf..1a0c5608f3440 100644
--- a/bundles/org.openhab.binding.adorne/.classpath
+++ b/bundles/org.openhab.binding.adorne/.classpath
@@ -28,5 +28,11 @@
+
+
+
+
+
+
diff --git a/bundles/org.openhab.binding.adorne/README.md b/bundles/org.openhab.binding.adorne/README.md
index 73ea0990675d7..89c98c94d3313 100644
--- a/bundles/org.openhab.binding.adorne/README.md
+++ b/bundles/org.openhab.binding.adorne/README.md
@@ -110,4 +110,4 @@ sitemap demo label="Adorne Binding Demo"
Setpoint item=LightBedroomDimmer2 label="Bedroom 2" icon="light-on" minValue=1 maxValue=100 step=5
}
}
-```
\ No newline at end of file
+```
diff --git a/bundles/org.openhab.binding.adorne/src/main/java/org/openhab/binding/adorne/internal/hub/AdorneHubController.java b/bundles/org.openhab.binding.adorne/src/main/java/org/openhab/binding/adorne/internal/hub/AdorneHubController.java
index 3be3616284c80..e211425872188 100644
--- a/bundles/org.openhab.binding.adorne/src/main/java/org/openhab/binding/adorne/internal/hub/AdorneHubController.java
+++ b/bundles/org.openhab.binding.adorne/src/main/java/org/openhab/binding/adorne/internal/hub/AdorneHubController.java
@@ -333,7 +333,6 @@ private void msgLoop() {
cancelCommands();
hubControllerConnected.cancel(false);
logger.info("Exiting hub controller");
-
}
private boolean shouldStop() {
diff --git a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/handler/AirQualityHandler.java b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/handler/AirQualityHandler.java
index 472d4dbfa72db..10af8f9eabd97 100644
--- a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/handler/AirQualityHandler.java
+++ b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/handler/AirQualityHandler.java
@@ -23,9 +23,6 @@
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
-import javax.measure.quantity.Pressure;
-import javax.measure.quantity.Temperature;
-
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.eclipse.smarthome.core.library.types.DateTimeType;
@@ -265,7 +262,6 @@ private AirQualityJsonResponse getAirQualityData() {
errorMsg = "missing data sub-object";
logger.warn("Error in aqicn.org (Air Quality) response: {}", errorMsg);
}
-
} catch (MalformedURLException e) {
errorMsg = e.getMessage();
logger.warn("Constructed url is not valid: {}", errorMsg);
@@ -300,7 +296,7 @@ public static Object getValue(String channelId, AirQualityJsonResponse data) thr
case CO:
return data.getData().getIaqi().getCo();
case SO2:
- return data.getData().getIaqi().getSo2();
+ return data.getData().getIaqi().getSo2();
case LOCATIONNAME:
return data.getData().getCity().getName();
case STATIONID:
@@ -310,9 +306,9 @@ public static Object getValue(String channelId, AirQualityJsonResponse data) thr
case OBSERVATIONTIME:
return data.getData().getTime().getObservationTime();
case TEMPERATURE:
- return new QuantityType(data.getData().getIaqi().getT(), API_TEMPERATURE_UNIT);
+ return new QuantityType<>(data.getData().getIaqi().getT(), API_TEMPERATURE_UNIT);
case PRESSURE:
- return new QuantityType(data.getData().getIaqi().getP(), API_PRESSURE_UNIT);
+ return new QuantityType<>(data.getData().getIaqi().getP(), API_PRESSURE_UNIT);
case HUMIDITY:
return new QuantityType<>(data.getData().getIaqi().getH(), API_HUMIDITY_UNIT);
case DOMINENTPOL:
diff --git a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonCity.java b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonCity.java
index 99506931fb57e..ec595de9212f8 100644
--- a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonCity.java
+++ b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonCity.java
@@ -39,7 +39,7 @@ public String getUrl() {
}
public String getGeo() {
- List list = new ArrayList();
+ List list = new ArrayList<>();
for (int i = 0; i < geo.size(); i++) {
list.add(geo.get(i).toString());
}
diff --git a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonData.java b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonData.java
index f5274840bb47e..ef4ff8e22fd90 100644
--- a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonData.java
+++ b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonData.java
@@ -87,7 +87,7 @@ public AirQualityJsonCity getCity() {
* @return {String}
*/
public String getAttributions() {
- List list = new ArrayList();
+ List list = new ArrayList<>();
for (int i = 0; i < attributions.size(); i++) {
list.add(attributions.get(i).getName());
}
diff --git a/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayBindingProperties.java b/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayBindingProperties.java
index b825c80f59d2f..4d20375dae0a6 100644
--- a/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayBindingProperties.java
+++ b/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayBindingProperties.java
@@ -40,7 +40,6 @@ public class AllPlayBindingProperties {
private static final String ZONE_MEMBER_SEPARATOR_DEFAULT_VALUE = ",";
public AllPlayBindingProperties(Dictionary properties) {
-
rewindSkipTimeInSec = getIntegerProperty(properties, REWIND_SKIP_TIME_PROPERTY, REWIND_SKIP_TIME_DEFAULT_VALUE);
fastForwardSkipTimeInSec = getIntegerProperty(properties, FAST_FORWARD_SKIP_TIME_PROPERTY,
FAST_FORWARD_SKIP_TIME_DEFAULT_VALUE);
diff --git a/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayHandlerFactory.java b/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayHandlerFactory.java
index 1d533b842bfe3..62938017785e1 100644
--- a/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayHandlerFactory.java
+++ b/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayHandlerFactory.java
@@ -99,7 +99,7 @@ private void registerAudioSink(Thing thing, AllPlayHandler handler) {
AllPlayAudioSink audioSink = new AllPlayAudioSink(handler, audioHTTPServer, callbackUrl);
@SuppressWarnings("unchecked")
ServiceRegistration reg = (ServiceRegistration) bundleContext
- .registerService(AudioSink.class.getName(), audioSink, new Hashtable());
+ .registerService(AudioSink.class.getName(), audioSink, new Hashtable<>());
audioSinkRegistrations.put(thing.getUID().toString(), reg);
}
diff --git a/bundles/org.openhab.binding.amazondashbutton/.settings/org.eclipse.core.resources.prefs b/bundles/org.openhab.binding.amazondashbutton/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index abdea9ac032d4..0000000000000
--- a/bundles/org.openhab.binding.amazondashbutton/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-eclipse.preferences.version=1
-encoding//src/main/java=UTF-8
-encoding//src/main/resources=UTF-8
-encoding/=UTF-8
diff --git a/bundles/org.openhab.binding.amazondashbutton/.settings/org.eclipse.m2e.core.prefs b/bundles/org.openhab.binding.amazondashbutton/.settings/org.eclipse.m2e.core.prefs
deleted file mode 100644
index f897a7f1cb238..0000000000000
--- a/bundles/org.openhab.binding.amazondashbutton/.settings/org.eclipse.m2e.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-activeProfiles=
-eclipse.preferences.version=1
-resolveWorkspaceProjects=true
-version=1
diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/AccountServlet.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/AccountServlet.java
index c9cbec6a130ab..41d4bceae4255 100644
--- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/AccountServlet.java
+++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/AccountServlet.java
@@ -247,7 +247,6 @@ protected void doGet(@Nullable HttpServletRequest req, @Nullable HttpServletResp
try {
Connection connection = this.connectionToInitialize;
if (uri.startsWith(FORWARD_URI_PART) && connection != null) {
-
String getUrl = "https://www." + connection.getAmazonSite() + "/"
+ uri.substring(FORWARD_URI_PART.length());
@@ -271,7 +270,6 @@ protected void doGet(@Nullable HttpServletRequest req, @Nullable HttpServletResp
}
if (connection != null && connection.verifyLogin()) {
-
// handle commands
if (baseUrl.equals("/logout") || baseUrl.equals("/logout/")) {
this.connectionToInitialize = reCreateConnection();
@@ -633,7 +631,6 @@ void handleProxyRequest(Connection connection, HttpServletResponse resp, String
{
String location = urlConnection.getHeaderField("location");
if (location.contains("/ap/maplanding")) {
-
try {
connection.registerConnectionAsApp(location);
account.setConnection(connection);
@@ -646,7 +643,6 @@ void handleProxyRequest(Connection connection, HttpServletResponse resp, String
this.connectionToInitialize = null;
return;
}
-
}
String startString = "https://www." + connection.getAmazonSite() + "/";
diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/Connection.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/Connection.java
index 7f8ed58eabb9c..51c1ebfed0371 100644
--- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/Connection.java
+++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/Connection.java
@@ -336,7 +336,6 @@ public boolean tryRestoreLogin(@Nullable String data, @Nullable String overloade
} catch (IOException e) {
return false;
} catch (URISyntaxException e) {
-
}
}
return false;
@@ -539,7 +538,6 @@ public HttpsURLConnection makeRequest(String verb, String url, @Nullable String
URI uri = connection.getURL().toURI();
if (customHeaders == null || !customHeaders.containsKey("Cookie")) {
-
StringBuilder cookieHeaderBuilder = new StringBuilder();
for (HttpCookie cookie : cookieManager.getCookieStore().get(uri)) {
if (cookieHeaderBuilder.length() > 0) {
@@ -559,7 +557,6 @@ public HttpsURLConnection makeRequest(String verb, String url, @Nullable String
}
}
if (postData != null) {
-
logger.debug("{}: {}", verb, postData);
// post data
byte[] postDataBytes = postData.getBytes(StandardCharsets.UTF_8);
@@ -595,7 +592,6 @@ public HttpsURLConnection makeRequest(String verb, String url, @Nullable String
// store cookie
for (String cookieHeader : header.getValue()) {
if (StringUtils.isNotEmpty(cookieHeader)) {
-
List cookies = HttpCookie.parse(cookieHeader);
for (HttpCookie cookie : cookies) {
cookieManager.getCookieStore().add(uri, cookie);
@@ -646,9 +642,7 @@ public HttpsURLConnection makeRequest(String verb, String url, @Nullable String
return connection;
}
throw new HttpException(code, verb + " url '" + url + "' failed: " + connection.getResponseMessage());
-
} catch (IOException e) {
-
if (connection != null) {
connection.disconnect();
}
@@ -753,7 +747,6 @@ public String registerConnectionAsApp(String oAutRedirectUrl)
}
private void exchangeToken() throws IOException, URISyntaxException {
-
this.renewTime = 0;
String cookiesJson = "{\"cookies\":{\"." + getAmazonSite() + "\":[]}}";
String cookiesBase64 = Base64.getEncoder().encodeToString(cookiesJson.getBytes());
diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/WebSocketConnection.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/WebSocketConnection.java
index 2ebcc2e842629..ec996bfde5a43 100644
--- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/WebSocketConnection.java
+++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/WebSocketConnection.java
@@ -382,7 +382,6 @@ public void onWebSocketBinary(byte @Nullable [] data, int offset, int len) {
sendMessage(
"0xa6f6a951 0x0000009c {\"protocolName\":\"A:H\",\"parameters\":{\"AlphaProtocolHandler.receiveWindowSize\":\"16\",\"AlphaProtocolHandler.maxFragmentSize\":\"16000\"}}TUNE");
sendMessage(encodeGWHandshake());
-
} else if (this.msgCounter == 1) {
sendMessage(encodeGWRegister());
sendPing();
@@ -395,7 +394,6 @@ public void onWebSocketBinary(byte @Nullable [] data, int offset, int len) {
Message message = parseIncomingMessage(buffer);
if (message.service.equals("FABE") && message.content.messageType.equals("PON")
&& message.content.payloadData.length > 0) {
-
logger.debug("Pong received");
WebSocketConnection.this.clearPongTimeoutTimer();
return;
@@ -416,7 +414,6 @@ public void onWebSocketBinary(byte @Nullable [] data, int offset, int len) {
@Override
public void onWebSocketText(@Nullable String message) {
-
}
@Override
@@ -464,7 +461,6 @@ long computeBits(long input, long len) {
}
long toUnsignedInt(long value) {
-
long result = value;
if (0 > value) {
result = 4294967295L + value + 1;
@@ -559,7 +555,6 @@ void encode(byte[] data, long b, int offset, int len) {
}
byte[] encodePing() {
-
// MSG 0x00000065 0x0e414e47 f 0x00000001 0xbc2fbb5f 0x00000062 PIN � ��� �� R e g u l a rFABE
this.messageId++;
String msg = "MSG 0x00000065 "; // Message-type and Channel = CHANNEL_FOR_HEARTBEAT;
diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/ChannelHandlerAnnouncement.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/ChannelHandlerAnnouncement.java
index 2464c2e3cb068..89af22d404a7f 100644
--- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/ChannelHandlerAnnouncement.java
+++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/ChannelHandlerAnnouncement.java
@@ -66,10 +66,10 @@ public boolean tryHandleCommand(Device device, Connection connection, String cha
}
Boolean sound = request.sound;
if (sound != null) {
- if (sound == false && !speak.startsWith("")) {
+ if (!sound && !speak.startsWith("")) {
speak = "" + StringEscapeUtils.escapeXml(speak) + "";
}
- if (sound == true && speak.startsWith("")) {
+ if (sound && speak.startsWith("")) {
body = "Error: The combination of sound and speak in SSML syntax is not allowed";
title = "Error";
speak = "Error: The combination of sound and speak in SSML syntax is not allowed";
diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/discovery/AmazonEchoDiscovery.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/discovery/AmazonEchoDiscovery.java
index 0cb44a44a5588..6b8a34a24344e 100644
--- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/discovery/AmazonEchoDiscovery.java
+++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/discovery/AmazonEchoDiscovery.java
@@ -194,7 +194,6 @@ public synchronized void discoverFlashBriefingProfiles(String currentFlashBriefi
}
if (!discoverdFlashBriefings.contains(currentFlashBriefingJson)) {
-
ThingUID freeThingUID = null;
int freeIndex = 0;
for (int i = 1; i < 1000; i++) {
diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/AccountHandler.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/AccountHandler.java
index b4482c4024ed3..5f70a4216f7e1 100644
--- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/AccountHandler.java
+++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/AccountHandler.java
@@ -315,7 +315,6 @@ private void checkLogin() {
setConnection(currentConnection);
}
} else {
-
// read session data from property
String sessionStore = this.stateStorage.get("sessionStorage");
@@ -582,7 +581,6 @@ private void refreshData() {
}
public List updateDeviceList() {
-
Connection currentConnection = connection;
if (currentConnection == null) {
return new ArrayList<>();
diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/EchoHandler.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/EchoHandler.java
index 5867ec69de201..eabce0939a58a 100644
--- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/EchoHandler.java
+++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/EchoHandler.java
@@ -12,46 +12,7 @@
*/
package org.openhab.binding.amazonechocontrol.internal.handler;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_AMAZON_MUSIC;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_AMAZON_MUSIC_PLAY_LIST_ID;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_AMAZON_MUSIC_TRACK_ID;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_ASCENDING_ALARM;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_BLUETOOTH;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_BLUETOOTH_DEVICE_NAME;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_BLUETOOTH_MAC;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_EQUALIZER_BASS;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_EQUALIZER_MIDRANGE;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_EQUALIZER_TREBLE;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_IMAGE_URL;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_LAST_VOICE_COMMAND;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_MEDIA_LENGTH;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_MEDIA_PROGRESS;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_MEDIA_PROGRESS_TIME;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_MUSIC_PROVIDER_ID;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_NEXT_ALARM;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_NEXT_MUSIC_ALARM;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_NEXT_REMINDER;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_NEXT_TIMER;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_NOTIFICATION_VOLUME;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_PLAYER;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_PLAY_ALARM_SOUND;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_PLAY_MUSIC_VOICE_COMMAND;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_PLAY_ON_DEVICE;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_PROVIDER_DISPLAY_NAME;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_RADIO;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_RADIO_STATION_ID;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_REMIND;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_SHUFFLE;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_START_COMMAND;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_START_ROUTINE;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_SUBTITLE1;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_SUBTITLE2;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_TEXT_TO_SPEECH;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_TEXT_TO_SPEECH_VOLUME;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_TITLE;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_VOLUME;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.DEVICE_PROPERTY_SERIAL_NUMBER;
-import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.FLASH_BRIEFING_COMMAND_PREFIX;
+import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.*;
import java.io.IOException;
import java.net.URISyntaxException;
@@ -71,8 +32,6 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import javax.measure.quantity.Time;
-
import org.apache.commons.lang.StringUtils;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
@@ -365,7 +324,6 @@ public void handleCommand(ChannelUID channelUID, Command command) {
// Media progress commands
Long mediaPosition = null;
if (channelId.equals(CHANNEL_MEDIA_PROGRESS)) {
-
if (command instanceof PercentType) {
PercentType value = (PercentType) command;
int percent = value.intValue();
@@ -397,7 +355,6 @@ public void handleCommand(ChannelUID channelUID, Command command) {
mediaStartMs = System.currentTimeMillis() - this.mediaProgressMs;
updateMediaProgress(false);
}
-
}
// Volume commands
if (channelId.equals(CHANNEL_VOLUME)) {
@@ -405,10 +362,8 @@ public void handleCommand(ChannelUID channelUID, Command command) {
if (command instanceof PercentType) {
PercentType value = (PercentType) command;
volume = value.intValue();
-
} else if (command == OnOffType.OFF) {
volume = 0;
-
} else if (command == OnOffType.ON) {
volume = lastKnownVolume;
} else if (command == IncreaseDecreaseType.INCREASE) {
@@ -426,7 +381,6 @@ public void handleCommand(ChannelUID channelUID, Command command) {
if (StringUtils.equals(device.deviceFamily, "WHA")) {
connection.command(device, "{\"type\":\"VolumeLevelCommand\",\"volumeLevel\":" + volume
+ ",\"contentFocusClientId\":\"Default\"}");
-
} else {
Map parameters = new HashMap<>();
parameters.put("value", volume);
@@ -436,7 +390,6 @@ public void handleCommand(ChannelUID channelUID, Command command) {
updateState(CHANNEL_VOLUME, new PercentType(lastKnownVolume));
waitForUpdate = -1;
}
-
}
// equalizer commands
if (channelId.equals(CHANNEL_EQUALIZER_BASS) || channelId.equals(CHANNEL_EQUALIZER_MIDRANGE)
@@ -468,7 +421,6 @@ public void handleCommand(ChannelUID channelUID, Command command) {
waitForUpdate = 3000;
}
}
-
}
}
if (channelId.equals(CHANNEL_PLAY_MUSIC_VOICE_COMMAND)) {
@@ -526,28 +478,23 @@ public void handleCommand(ChannelUID channelUID, Command command) {
// amazon music commands
if (channelId.equals(CHANNEL_AMAZON_MUSIC_TRACK_ID)) {
if (command instanceof StringType) {
-
String trackId = ((StringType) command).toFullString();
if (StringUtils.isNotEmpty(trackId)) {
waitForUpdate = 3000;
}
connection.playAmazonMusicTrack(device, trackId);
-
}
}
if (channelId.equals(CHANNEL_AMAZON_MUSIC_PLAY_LIST_ID)) {
if (command instanceof StringType) {
-
String playListId = ((StringType) command).toFullString();
if (StringUtils.isNotEmpty(playListId)) {
waitForUpdate = 3000;
}
connection.playAmazonMusicPlayList(device, playListId);
-
}
}
if (channelId.equals(CHANNEL_AMAZON_MUSIC)) {
-
if (command == OnOffType.ON) {
String lastKnownAmazonMusicId = this.lastKnownAmazonMusicId;
if (StringUtils.isNotEmpty(lastKnownAmazonMusicId)) {
@@ -616,7 +563,6 @@ public void handleCommand(ChannelUID channelUID, Command command) {
currentNotifcationUpdateTimer = scheduler.scheduleWithFixedDelay(() -> {
updateNotificationTimerState();
}, 1, 1, TimeUnit.SECONDS);
-
}
}
}
@@ -759,7 +705,6 @@ private boolean handleEqualizerCommands(String channelId, Command command, Conne
logger.debug("Update equalizer failed", e);
this.lastKnownEqualizer = null;
}
-
}
}
return false;
@@ -976,7 +921,6 @@ public void updateState(AccountHandler accountHandler, @Nullable Device device,
} else {
stopProgressTimer();
}
-
} else {
stopProgressTimer();
mediaProgressMs = 0;
@@ -988,17 +932,13 @@ public void updateState(AccountHandler accountHandler, @Nullable Device device,
JsonMediaState mediaState = null;
try {
-
if (StringUtils.equalsIgnoreCase(musicProviderId, "AMAZON_MUSIC")
|| StringUtils.equalsIgnoreCase(musicProviderId, "TUNEIN")) {
mediaState = connection.getMediaState(device);
}
-
} catch (HttpException e) {
if (e.getCode() == 400) {
-
updateState(CHANNEL_RADIO_STATION_ID, new StringType(""));
-
} else {
logger.info("getMediaState fails", e);
}
@@ -1094,7 +1034,6 @@ public void updateState(AccountHandler accountHandler, @Nullable Device device,
if (queueEntries != null && queueEntries.length > 0) {
QueueEntry entry = queueEntries[0];
if (entry != null) {
-
if (isRadio) {
if (StringUtils.isEmpty(imageUrl) && entry.imageURL != null) {
imageUrl = entry.imageURL;
@@ -1128,7 +1067,6 @@ public void updateState(AccountHandler accountHandler, @Nullable Device device,
volume = mediaState.volume;
}
if (playerInfo != null && volume == null) {
-
Volume volumnInfo = playerInfo.volume;
if (volumnInfo != null) {
volume = volumnInfo.volume;
@@ -1196,7 +1134,6 @@ public void updateState(AccountHandler accountHandler, @Nullable Device device,
} else {
updateState(CHANNEL_NOTIFICATION_VOLUME, UnDefType.UNDEF);
}
-
} catch (Exception e) {
this.logger.debug("Handle updateState {} failed: {}", this.getThing().getUID(), e.getMessage(), e);
@@ -1240,7 +1177,6 @@ private void updateEqualizerState() {
if (treble != null) {
updateState(CHANNEL_EQUALIZER_TREBLE, new DecimalType(treble));
}
-
}
private void updateMediaProgress() {
@@ -1259,10 +1195,9 @@ private void updateMediaProgress(boolean updateMediaLength) {
updateState(CHANNEL_MEDIA_PROGRESS, UnDefType.UNDEF);
}
updateState(CHANNEL_MEDIA_PROGRESS_TIME,
- new QuantityType
diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchBindingConstants.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchBindingConstants.java
index 6118940695601..0bd8c8bec0123 100644
--- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchBindingConstants.java
+++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchBindingConstants.java
@@ -14,6 +14,7 @@
import java.util.Collections;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -32,16 +33,16 @@ public class BoseSoundTouchBindingConstants {
public static final String BINDING_ID = "bosesoundtouch";
// List of all Thing Type UIDs
- public final static ThingTypeUID BST_UNKNOWN_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "device");
+ public static final ThingTypeUID BST_UNKNOWN_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "device");
- public final static ThingTypeUID BST_10_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "10");
- public final static ThingTypeUID BST_20_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "20");
- public final static ThingTypeUID BST_30_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "30");
- public final static ThingTypeUID BST_300_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "300");
- public final static ThingTypeUID BST_WLA_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "wirelessLinkAdapter");
- public final static ThingTypeUID BST_WSMS_THING_TYPE_UID = new ThingTypeUID(BINDING_ID,
+ public static final ThingTypeUID BST_10_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "10");
+ public static final ThingTypeUID BST_20_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "20");
+ public static final ThingTypeUID BST_30_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "30");
+ public static final ThingTypeUID BST_300_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "300");
+ public static final ThingTypeUID BST_WLA_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "wirelessLinkAdapter");
+ public static final ThingTypeUID BST_WSMS_THING_TYPE_UID = new ThingTypeUID(BINDING_ID,
"waveSoundTouchMusicSystemIV");
- public final static ThingTypeUID BST_SA5A_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "sa5Amplifier");
+ public static final ThingTypeUID BST_SA5A_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "sa5Amplifier");
public static final Set SUPPORTED_KNOWN_THING_TYPES_UIDS = Collections.unmodifiableSet(Stream
.of(BST_UNKNOWN_THING_TYPE_UID, BST_10_THING_TYPE_UID, BST_20_THING_TYPE_UID, BST_30_THING_TYPE_UID,
@@ -50,6 +51,13 @@ public class BoseSoundTouchBindingConstants {
public static final Set SUPPORTED_THING_TYPES_UIDS = new HashSet<>(SUPPORTED_KNOWN_THING_TYPES_UIDS);
+ // Partial list of Channel Type IDs
+ public static final String CHANNEL_TYPE_OPERATION_MODE_DEFAULT = "operationMode_default";
+ public static final String CHANNEL_TYPE_OPERATION_MODE_BST_10_20_30 = "operationMode_BST_10_20_30";
+ public static final String CHANNEL_TYPE_OPERATION_MODE_BST_300 = "operationMode_BST_300";
+ public static final String CHANNEL_TYPE_OPERATION_MODE_BST_SA5A = "operationMode_BST_SA5_Amplifier";
+ public static final String CHANNEL_TYPE_OPERATION_MODE_BST_WLA = "operationMode_BST_WLA";
+
// List of all Channel IDs
public static final String CHANNEL_POWER = "power";
public static final String CHANNEL_VOLUME = "volume";
@@ -74,7 +82,16 @@ public class BoseSoundTouchBindingConstants {
public static final String CHANNEL_NOWPLAYING_TRACK = "nowPlayingTrack";
public static final String CHANNEL_NOTIFICATION_SOUND = "notificationsound";
+ public static final List CHANNEL_IDS = Collections.unmodifiableList(
+ Stream.of(CHANNEL_POWER, CHANNEL_VOLUME, CHANNEL_MUTE, CHANNEL_OPERATIONMODE, CHANNEL_PLAYER_CONTROL,
+ CHANNEL_PRESET, CHANNEL_BASS, CHANNEL_RATEENABLED, CHANNEL_SKIPENABLED, CHANNEL_SKIPPREVIOUSENABLED,
+ CHANNEL_SAVE_AS_PRESET, CHANNEL_KEY_CODE, CHANNEL_NOWPLAYING_ALBUM, CHANNEL_NOWPLAYING_ARTWORK,
+ CHANNEL_NOWPLAYING_ARTIST, CHANNEL_NOWPLAYING_DESCRIPTION, CHANNEL_NOWPLAYING_GENRE,
+ CHANNEL_NOWPLAYING_ITEMNAME, CHANNEL_NOWPLAYING_STATIONLOCATION, CHANNEL_NOWPLAYING_STATIONNAME,
+ CHANNEL_NOWPLAYING_TRACK, CHANNEL_NOTIFICATION_SOUND).collect(Collectors.toList()));
+
// Device information parameters;
public static final String DEVICE_INFO_NAME = "INFO_NAME";
public static final String DEVICE_INFO_TYPE = "INFO_TYPE";
+
}
diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/PresetContainer.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/PresetContainer.java
index 30e75ec41575b..476e6ef36040e 100644
--- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/PresetContainer.java
+++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/PresetContainer.java
@@ -77,9 +77,10 @@ public void put(int presetID, ContentItem preset) throws ContentItemNotPresetabl
throw new ContentItemNotPresetableException();
}
}
-
+
/**
* Remove the Preset stored under the specified Id
+ *
* @param presetID
*/
public void remove(int presetID) {
@@ -126,7 +127,7 @@ private void writeToStorage() {
}
}
- if (listOfPresets.size() > 0) {
+ if (!listOfPresets.isEmpty()) {
listOfPresets.forEach(item -> storage.put(String.valueOf(item.getPresetID()), item));
}
}
diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/discovery/SoundTouchDiscoveryParticipant.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/discovery/SoundTouchDiscoveryParticipant.java
index a01d3e2815212..4a80fb3e60953 100644
--- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/discovery/SoundTouchDiscoveryParticipant.java
+++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/discovery/SoundTouchDiscoveryParticipant.java
@@ -60,17 +60,15 @@ public DiscoveryResult createResult(ServiceInfo info) {
DiscoveryResult result = null;
ThingUID uid = getThingUID(info);
if (uid != null) {
-
// remove the domain from the name
InetAddress[] addrs = info.getInetAddresses();
Map properties = new HashMap<>(2);
-
+
String label = null;
if (BST_10_THING_TYPE_UID.equals(uid.getThingTypeUID())) {
try {
- String group = DiscoveryUtil
- .executeUrl("http://" + addrs[0].getHostAddress() + ":8090/getGroup");
+ String group = DiscoveryUtil.executeUrl("http://" + addrs[0].getHostAddress() + ":8090/getGroup");
label = DiscoveryUtil.getContentOfFirstElement(group, "name");
} catch (IOException e) {
logger.debug("Can't obtain label for group. Will use the default one");
@@ -80,7 +78,7 @@ public DiscoveryResult createResult(ServiceInfo info) {
if (label == null || label.isEmpty()) {
label = info.getName();
}
-
+
if (label == null || label.isEmpty()) {
label = "Bose SoundTouch";
}
@@ -93,9 +91,10 @@ public DiscoveryResult createResult(ServiceInfo info) {
properties.put(BoseSoundTouchConfiguration.HOST, addrs[0].getHostAddress());
if (getMacAddress(info) != null) {
- properties.put(BoseSoundTouchConfiguration.MAC_ADDRESS, new String(getMacAddress(info), StandardCharsets.UTF_8));
+ properties.put(BoseSoundTouchConfiguration.MAC_ADDRESS,
+ new String(getMacAddress(info), StandardCharsets.UTF_8));
}
-
+
// Set manufacturer as thing property (if available)
byte[] manufacturer = info.getPropertyBytes("MANUFACTURER");
if (manufacturer != null) {
diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/handler/BoseSoundTouchHandler.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/handler/BoseSoundTouchHandler.java
index ae9eb40a7edd7..819dc224198ba 100644
--- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/handler/BoseSoundTouchHandler.java
+++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/handler/BoseSoundTouchHandler.java
@@ -16,7 +16,6 @@
import java.io.IOException;
import java.net.URI;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
@@ -46,7 +45,9 @@
import org.eclipse.smarthome.core.thing.Thing;
import org.eclipse.smarthome.core.thing.ThingStatus;
import org.eclipse.smarthome.core.thing.ThingStatusDetail;
+import org.eclipse.smarthome.core.thing.ThingTypeUID;
import org.eclipse.smarthome.core.thing.binding.BaseThingHandler;
+import org.eclipse.smarthome.core.thing.binding.ThingHandlerCallback;
import org.eclipse.smarthome.core.thing.type.ChannelTypeUID;
import org.eclipse.smarthome.core.types.Command;
import org.eclipse.smarthome.core.types.RefreshType;
@@ -143,7 +144,8 @@ public void updateState(String channelID, State state) {
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
if (commandExecutor == null) {
- logger.debug("{}: Can't handle command '{}' for channel '{}' because of not initialized connection.", getDeviceName(), command, channelUID);
+ logger.debug("{}: Can't handle command '{}' for channel '{}' because of not initialized connection.",
+ getDeviceName(), command, channelUID);
return;
} else {
logger.debug("{}: handleCommand({}, {});", getDeviceName(), channelUID, command);
@@ -259,14 +261,17 @@ public void handleCommand(ChannelUID channelUID, Command command) {
if (chTypeUid != null) {
switch (channel.getChannelTypeUID().getId()) {
case CHANNEL_NOTIFICATION_SOUND:
- String appKey = Objects.toString(getConfig().get(BoseSoundTouchConfiguration.APP_KEY), null);
+ String appKey = Objects.toString(getConfig().get(BoseSoundTouchConfiguration.APP_KEY),
+ null);
if (appKey != null && !appKey.isEmpty()) {
if (command instanceof StringType) {
String url = command.toString();
BoseSoundTouchNotificationChannelConfiguration notificationConfiguration = channel
- .getConfiguration().as(BoseSoundTouchNotificationChannelConfiguration.class);
+ .getConfiguration()
+ .as(BoseSoundTouchNotificationChannelConfiguration.class);
if (!url.isEmpty()) {
- commandExecutor.playNotificationSound(appKey, notificationConfiguration, url);
+ commandExecutor.playNotificationSound(appKey, notificationConfiguration,
+ url);
}
}
} else {
@@ -280,7 +285,6 @@ public void handleCommand(ChannelUID channelUID, Command command) {
channelUID.getId());
break;
}
-
}
/**
@@ -325,7 +329,8 @@ public String getDeviceType() {
* @return the MAC Address of this device (in format "123456789ABC")
*/
public String getMacAddress() {
- return ((String) getThing().getConfiguration().get(BoseSoundTouchConfiguration.MAC_ADDRESS)).replaceAll(":", "");
+ return ((String) getThing().getConfiguration().get(BoseSoundTouchConfiguration.MAC_ADDRESS)).replaceAll(":",
+ "");
}
/**
@@ -475,15 +480,14 @@ private void checkConnection() {
}
public void refreshPresetChannel() {
- List stateOptions = presetContainer.getAllPresets().stream()
- .map(e -> e.toStateOption())
+ List stateOptions = presetContainer.getAllPresets().stream().map(e -> e.toStateOption())
.sorted(Comparator.comparing(StateOption::getValue)).collect(Collectors.toList());
stateOptionProvider.setStateOptions(new ChannelUID(getThing().getUID(), CHANNEL_PRESET), stateOptions);
}
public void handleGroupUpdated(BoseSoundTouchConfiguration masterPlayerConfiguration) {
String deviceId = getMacAddress();
-
+
if (masterPlayerConfiguration != null && masterPlayerConfiguration.macAddress != null) {
// Stereo pair
if (Objects.equals(masterPlayerConfiguration.macAddress, deviceId)) {
@@ -507,7 +511,7 @@ public void handleGroupUpdated(BoseSoundTouchConfiguration masterPlayerConfigura
if (getThing().getThingTypeUID().equals(BST_10_THING_TYPE_UID)) {
if (getThing().getChannels().isEmpty()) {
logger.debug("{}: Stereo Pair was disbounded. Restoring channels", getDeviceName());
- updateThing(editThing().withChannels(getAllChannels()).build());
+ updateThing(editThing().withChannels(getAllChannels(BST_10_THING_TYPE_UID)).build());
} else {
logger.debug("{}: Stereo Pair was disbounded.", getDeviceName());
}
@@ -517,32 +521,44 @@ public void handleGroupUpdated(BoseSoundTouchConfiguration masterPlayerConfigura
}
}
}
-
- private List getAllChannels() {
- List allChannels = new ArrayList<>();
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_POWER), new ChannelTypeUID(BINDING_ID, CHANNEL_POWER)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_VOLUME), new ChannelTypeUID(BINDING_ID, CHANNEL_VOLUME)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_MUTE), new ChannelTypeUID(BINDING_ID, CHANNEL_MUTE)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_OPERATIONMODE), new ChannelTypeUID(BINDING_ID, "operationMode_BST_10_20_30")).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_PLAYER_CONTROL), new ChannelTypeUID(BINDING_ID, CHANNEL_PLAYER_CONTROL)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_PRESET), new ChannelTypeUID(BINDING_ID, CHANNEL_PRESET)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_BASS), new ChannelTypeUID(BINDING_ID, CHANNEL_BASS)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_RATEENABLED), new ChannelTypeUID(BINDING_ID, CHANNEL_RATEENABLED)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_SKIPENABLED), new ChannelTypeUID(BINDING_ID, CHANNEL_SKIPENABLED)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_SKIPPREVIOUSENABLED), new ChannelTypeUID(BINDING_ID, CHANNEL_SKIPPREVIOUSENABLED)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_SAVE_AS_PRESET), new ChannelTypeUID(BINDING_ID, CHANNEL_SAVE_AS_PRESET)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_KEY_CODE), new ChannelTypeUID(BINDING_ID, CHANNEL_KEY_CODE)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_NOWPLAYING_ALBUM), new ChannelTypeUID(BINDING_ID, CHANNEL_NOWPLAYING_ALBUM)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_NOWPLAYING_ARTWORK), new ChannelTypeUID(BINDING_ID, CHANNEL_NOWPLAYING_ARTWORK)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_NOWPLAYING_ARTIST), new ChannelTypeUID(BINDING_ID, CHANNEL_NOWPLAYING_ARTIST)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_NOWPLAYING_DESCRIPTION), new ChannelTypeUID(BINDING_ID, CHANNEL_NOWPLAYING_DESCRIPTION)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_NOWPLAYING_GENRE), new ChannelTypeUID(BINDING_ID, CHANNEL_NOWPLAYING_GENRE)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_NOWPLAYING_ITEMNAME), new ChannelTypeUID(BINDING_ID, CHANNEL_NOWPLAYING_ITEMNAME)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_NOWPLAYING_STATIONLOCATION), new ChannelTypeUID(BINDING_ID, CHANNEL_NOWPLAYING_STATIONLOCATION)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_NOWPLAYING_STATIONNAME), new ChannelTypeUID(BINDING_ID, CHANNEL_NOWPLAYING_STATIONNAME)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_NOWPLAYING_TRACK), new ChannelTypeUID(BINDING_ID, CHANNEL_NOWPLAYING_TRACK)).build());
- allChannels.add(getCallback().createChannelBuilder(new ChannelUID(getThing().getUID(), CHANNEL_NOTIFICATION_SOUND), new ChannelTypeUID(BINDING_ID, CHANNEL_NOTIFICATION_SOUND)).build());
-
- return allChannels;
+
+ private List getAllChannels(ThingTypeUID thingTypeUID) {
+ ThingHandlerCallback callback = getCallback();
+ if (callback == null) {
+ return Collections.emptyList();
+ }
+
+ return CHANNEL_IDS.stream()
+ .map(channelId -> callback.createChannelBuilder(new ChannelUID(getThing().getUID(), channelId),
+ createChannelTypeUID(thingTypeUID, channelId)).build())
+ .collect(Collectors.toList());
+ }
+
+ private ChannelTypeUID createChannelTypeUID(ThingTypeUID thingTypeUID, String channelId) {
+ if (CHANNEL_OPERATIONMODE.equals(channelId)) {
+ return createOperationModeChannelTypeUID(thingTypeUID);
+ }
+
+ return new ChannelTypeUID(BINDING_ID, channelId);
+ }
+
+ private ChannelTypeUID createOperationModeChannelTypeUID(ThingTypeUID thingTypeUID) {
+ String channelTypeId = CHANNEL_TYPE_OPERATION_MODE_DEFAULT;
+
+ if (BST_10_THING_TYPE_UID.equals(thingTypeUID) || BST_20_THING_TYPE_UID.equals(thingTypeUID)
+ || BST_30_THING_TYPE_UID.equals(thingTypeUID)) {
+ channelTypeId = CHANNEL_TYPE_OPERATION_MODE_BST_10_20_30;
+ } else if (BST_300_THING_TYPE_UID.equals(thingTypeUID)) {
+ channelTypeId = CHANNEL_TYPE_OPERATION_MODE_BST_300;
+ } else if (BST_SA5A_THING_TYPE_UID.equals(thingTypeUID)) {
+ channelTypeId = CHANNEL_TYPE_OPERATION_MODE_BST_SA5A;
+ } else if (BST_WLA_THING_TYPE_UID.equals(thingTypeUID)) {
+ channelTypeId = CHANNEL_TYPE_OPERATION_MODE_BST_WLA;
+ } else if (BST_WSMS_THING_TYPE_UID.equals(thingTypeUID)) {
+ channelTypeId = CHANNEL_TYPE_OPERATION_MODE_DEFAULT;
+ }
+
+ return new ChannelTypeUID(BINDING_ID, channelTypeId);
}
+
}
diff --git a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarHandler.java b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarHandler.java
index 4d03395bc39c3..0d9a7965cddac 100644
--- a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarHandler.java
+++ b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarHandler.java
@@ -26,8 +26,6 @@
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
-import javax.measure.quantity.Speed;
-
import org.apache.commons.lang.StringUtils;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.smarthome.core.library.types.DateTimeType;
@@ -76,7 +74,6 @@ public BuienradarHandler(Thing thing) {
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
-
}
@SuppressWarnings("null")
@@ -155,7 +152,7 @@ private void refresh(int tries, ZonedDateTime nextRefresh, int retryInSeconds) {
if (minutesFromNow >= 0 && minutesFromNow <= 115) {
final String label = String.format(Locale.ENGLISH, "forecast_%d", minutesFromNow);
- updateState(label, new QuantityType(intensity, SmartHomeUnits.MILLIMETRE_PER_HOUR));
+ updateState(label, new QuantityType<>(intensity, SmartHomeUnits.MILLIMETRE_PER_HOUR));
}
}
diff --git a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/BuienradarPredictionAPI.java b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/BuienradarPredictionAPI.java
index 67e007da3cf0d..d7be1ae52a2bd 100644
--- a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/BuienradarPredictionAPI.java
+++ b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/BuienradarPredictionAPI.java
@@ -151,8 +151,8 @@ public Optional> getPredictions(PointType location) throws IOEx
logger.warn("Buienradar API at URI {} return empty result", address);
return Optional.empty();
}
- final List predictions = new ArrayList(24);
- final List errors = new LinkedList();
+ final List predictions = new ArrayList<>(24);
+ final List errors = new LinkedList<>();
logger.debug("Returned result from buienradar: {}", result);
final String[] lines = result.split("\n");
Optional actual = Optional.empty();
diff --git a/bundles/org.openhab.binding.chromecast/pom.xml b/bundles/org.openhab.binding.chromecast/pom.xml
index 87e3ded78c5ba..9e0cd5fbf0b2f 100644
--- a/bundles/org.openhab.binding.chromecast/pom.xml
+++ b/bundles/org.openhab.binding.chromecast/pom.xml
@@ -21,27 +21,8 @@
su.litvak.chromecast
api-v2
- 0.11.2
+ 0.11.3
compile
-
-
-
- com.fasterxml.jackson.core
- jackson-databind
-
-
- com.fasterxml.jackson.core
- jackson-core
-
-
- com.fasterxml.jackson.core
- jackson-annotations
-
-
com.google.protobuf
diff --git a/bundles/org.openhab.binding.daikin/README.md b/bundles/org.openhab.binding.daikin/README.md
index 63bcf267fb654..6631527058765 100644
--- a/bundles/org.openhab.binding.daikin/README.md
+++ b/bundles/org.openhab.binding.daikin/README.md
@@ -31,8 +31,9 @@ For the BRP072A42:
| outdoortemp | The outdoor temperature as measured by the external part of the air conditioning system. May not be available when unit is off. |
| humidity | The indoor humidity as measured by the unit. This is not available on all units. |
| mode | The mode set for the unit (AUTO, DEHUMIDIFIER, COLD, HEAT, FAN) |
-| homekit mode | A mode that is compatible with homekit/alexa/google home (off, auto, heat, cool) |
+| homekit mode | A mode that is compatible with homekit/alexa/google home (off, auto, heat, cool) |
| fanspeed | The fan speed set for the unit (AUTO, SILENCE, LEVEL_1, LEVEL_2, LEVEL_3, LEVEL_4, LEVEL_5) |
+| fandir | The fan blade direction (STOPPED, VERTICAL, HORIZONTAL, VERTICAL_AND_HORIZONTAL) |
For the BRP15B61:
@@ -43,8 +44,8 @@ For the BRP15B61:
| indoortemp | The indoor temperature as measured by the unit. |
| outdoortemp | The outdoor temperature as measured by the external part of the air conditioning system. May not be available when unit is off. |
| mode | The mode set for the unit (AUTO, DEHUMIDIFIER, COLD, HEAT, FAN) |
-| homekit mode | A mode that is compatible with homekit/alexa/google home (off, auto, heat, cool) |
-| airbasefanspeed | The fan speed set for the unit (AIRSIDE, LEVEL_1, LEVEL_2, LEVEL_3, LEVEL_4, LEVEL_5, AUTO_LEVEL_1, AUTO_LEVEL_2, AUTO_LEVEL_3, AUTO_LEVEL_4, AUTO_LEVEL_5) |
+| homekit mode | A mode that is compatible with homekit/alexa/google home (off, auto, heat, cool) |
+| airbasefanspeed | The fan speed set for the unit (AUTO, AIRSIDE, LEVEL_1, LEVEL_2, LEVEL_3, LEVEL_4, LEVEL_5, AUTO_LEVEL_1, AUTO_LEVEL_2, AUTO_LEVEL_3, AUTO_LEVEL_4, AUTO_LEVEL_5) |
| zone1 | Turns zone 1 on/off for the air conditioning unit (if a zone controller is installed.) |
| zone2 | Turns zone 2 on/off for the air conditioning unit. |
| zone3 | Turns zone 3 on/off for the air conditioning unit. |
@@ -71,6 +72,7 @@ Number:Temperature DaikinACUnit_SetPoint { channel="daikin:ac_unit:living_room_a
String DaikinACUnit_Mode { channel="daikin:ac_unit:living_room_ac:mode" }
String DaikinACUnit_HomekitMode { channel="daikin:ac_unit:living_room_ac:homekitmode" }
String DaikinACUnit_Fan { channel="daikin:ac_unit:living_room_ac:fanspeed" }
+String DaikinACUnit_Fan_Movement { channel="daikin:ac_unit:living_room_ac:fandir" }
Number:Temperature DaikinACUnit_IndoorTemperature { channel="daikin:ac_unit:living_room_ac:indoortemp" }
Number:Temperature DaikinACUnit_OutdoorTemperature { channel="daikin:ac_unit:living_room_ac:outdoortemp" }
# Additional items for BRP1B61
diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseEnums.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseEnums.java
index 5edd6aa60d547..e6ab004b296f5 100644
--- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseEnums.java
+++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseEnums.java
@@ -60,6 +60,7 @@ public static AirbaseMode fromValue(int value) {
public enum AirbaseFanSpeed {
// level,f_auto,f_airside
+ AUTO (0, false, false),
LEVEL_1 (1, false, false),
LEVEL_2 (2, false, false),
LEVEL_3 (3, false, false),
@@ -99,6 +100,9 @@ public String getLabel() {
if (airside) {
return "Airside";
}
+ if (level == 0) {
+ return "Auto";
+ }
String label = "";
if (auto) {
label = "Auto ";
@@ -110,6 +114,9 @@ public static AirbaseFanSpeed fromValue(int rate, boolean auto, boolean airside)
if (airside) {
return AIRSIDE;
}
+ if (rate == 0) {
+ return AirbaseFanSpeed.AUTO;
+ }
for (AirbaseFanSpeed m : AirbaseFanSpeed.values()) {
if (m.getLevel() == rate && m.getAuto() == auto && m.getAirside() == airside) {
return m;
diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinAcUnitHandler.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinAcUnitHandler.java
index 120e51af880cf..f6b7885106594 100755
--- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinAcUnitHandler.java
+++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinAcUnitHandler.java
@@ -14,47 +14,25 @@
import java.io.IOException;
import java.util.Optional;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.IntStream;
-import java.util.EnumSet;
-import java.util.List;
-import java.util.ArrayList;
-
-import javax.measure.quantity.Temperature;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.smarthome.core.library.types.DecimalType;
import org.eclipse.smarthome.core.library.types.OnOffType;
-import org.eclipse.smarthome.core.library.types.QuantityType;
import org.eclipse.smarthome.core.library.types.StringType;
-import org.eclipse.smarthome.core.library.unit.SIUnits;
import org.eclipse.smarthome.core.thing.ChannelUID;
import org.eclipse.smarthome.core.thing.Thing;
-import org.eclipse.smarthome.core.thing.ThingTypeUID;
import org.eclipse.smarthome.core.thing.ThingStatus;
-import org.eclipse.smarthome.core.thing.ThingStatusDetail;
-import org.eclipse.smarthome.core.thing.binding.BaseThingHandler;
import org.eclipse.smarthome.core.types.Command;
-import org.eclipse.smarthome.core.types.RefreshType;
-import org.eclipse.smarthome.core.types.State;
-import org.eclipse.smarthome.core.types.StateOption;
import org.eclipse.smarthome.core.types.UnDefType;
import org.openhab.binding.daikin.internal.DaikinBindingConstants;
import org.openhab.binding.daikin.internal.DaikinCommunicationException;
-import org.openhab.binding.daikin.internal.DaikinWebTargets;
import org.openhab.binding.daikin.internal.DaikinDynamicStateDescriptionProvider;
import org.openhab.binding.daikin.internal.api.ControlInfo;
-import org.openhab.binding.daikin.internal.api.SensorInfo;
import org.openhab.binding.daikin.internal.api.Enums.FanMovement;
import org.openhab.binding.daikin.internal.api.Enums.FanSpeed;
-import org.openhab.binding.daikin.internal.api.Enums.Mode;
import org.openhab.binding.daikin.internal.api.Enums.HomekitMode;
-
-
-import org.openhab.binding.daikin.internal.config.DaikinConfiguration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.openhab.binding.daikin.internal.api.Enums.Mode;
+import org.openhab.binding.daikin.internal.api.SensorInfo;
/**
* Handles communicating with a Daikin air conditioning unit.
@@ -107,9 +85,10 @@ protected void pollStatus() throws IOException {
}
@Override
- protected boolean handleCommandInternal(ChannelUID channelUID, Command command) throws DaikinCommunicationException {
+ protected boolean handleCommandInternal(ChannelUID channelUID, Command command)
+ throws DaikinCommunicationException {
switch (channelUID.getId()) {
- case DaikinBindingConstants.CHANNEL_AC_FAN_DIR:
+ case DaikinBindingConstants.CHANNEL_AC_FAN_DIR:
if (command instanceof StringType) {
changeFanDir(((StringType) command).toString());
return true;
diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinAirbaseUnitHandler.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinAirbaseUnitHandler.java
index 38dd4be4005f8..b92927eaf168e 100755
--- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinAirbaseUnitHandler.java
+++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinAirbaseUnitHandler.java
@@ -13,45 +13,30 @@
package org.openhab.binding.daikin.internal.handler;
import java.io.IOException;
-import java.util.Optional;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.IntStream;
+import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
-import java.util.ArrayList;
-
-import javax.measure.quantity.Temperature;
+import java.util.Optional;
+import java.util.stream.IntStream;
-import org.eclipse.smarthome.core.library.types.DecimalType;
import org.eclipse.smarthome.core.library.types.OnOffType;
-import org.eclipse.smarthome.core.library.types.QuantityType;
import org.eclipse.smarthome.core.library.types.StringType;
-import org.eclipse.smarthome.core.library.unit.SIUnits;
import org.eclipse.smarthome.core.thing.ChannelUID;
import org.eclipse.smarthome.core.thing.Thing;
-import org.eclipse.smarthome.core.thing.ThingTypeUID;
import org.eclipse.smarthome.core.thing.ThingStatus;
-import org.eclipse.smarthome.core.thing.ThingStatusDetail;
-import org.eclipse.smarthome.core.thing.binding.BaseThingHandler;
import org.eclipse.smarthome.core.types.Command;
-import org.eclipse.smarthome.core.types.State;
import org.eclipse.smarthome.core.types.StateOption;
-import org.eclipse.smarthome.core.types.UnDefType;
import org.openhab.binding.daikin.internal.DaikinBindingConstants;
import org.openhab.binding.daikin.internal.DaikinCommunicationException;
-import org.openhab.binding.daikin.internal.DaikinWebTargets;
import org.openhab.binding.daikin.internal.DaikinDynamicStateDescriptionProvider;
+import org.openhab.binding.daikin.internal.api.Enums.HomekitMode;
import org.openhab.binding.daikin.internal.api.SensorInfo;
+import org.openhab.binding.daikin.internal.api.airbase.AirbaseControlInfo;
import org.openhab.binding.daikin.internal.api.airbase.AirbaseEnums.AirbaseFanSpeed;
-import org.openhab.binding.daikin.internal.api.airbase.AirbaseEnums.AirbaseMode;
import org.openhab.binding.daikin.internal.api.airbase.AirbaseEnums.AirbaseFeature;
-import org.openhab.binding.daikin.internal.api.airbase.AirbaseControlInfo;
+import org.openhab.binding.daikin.internal.api.airbase.AirbaseEnums.AirbaseMode;
import org.openhab.binding.daikin.internal.api.airbase.AirbaseModelInfo;
import org.openhab.binding.daikin.internal.api.airbase.AirbaseZoneInfo;
-import org.openhab.binding.daikin.internal.api.Enums.HomekitMode;
-
-import org.openhab.binding.daikin.internal.config.DaikinConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -72,12 +57,13 @@ public DaikinAirbaseUnitHandler(Thing thing, DaikinDynamicStateDescriptionProvid
}
@Override
- protected boolean handleCommandInternal(ChannelUID channelUID, Command command) throws DaikinCommunicationException {
+ protected boolean handleCommandInternal(ChannelUID channelUID, Command command)
+ throws DaikinCommunicationException {
if (channelUID.getId().startsWith(DaikinBindingConstants.CHANNEL_AIRBASE_AC_ZONE)) {
int zoneNumber = Integer.parseInt(channelUID.getId().substring(4));
if (command instanceof OnOffType) {
- changeZone(zoneNumber, command == OnOffType.ON);
- return true;
+ changeZone(zoneNumber, command == OnOffType.ON);
+ return true;
}
}
return false;
@@ -97,7 +83,8 @@ protected void pollStatus() throws IOException {
updateState(DaikinBindingConstants.CHANNEL_AC_POWER, controlInfo.power ? OnOffType.ON : OnOffType.OFF);
updateTemperatureChannel(DaikinBindingConstants.CHANNEL_AC_TEMP, controlInfo.temp);
updateState(DaikinBindingConstants.CHANNEL_AC_MODE, new StringType(controlInfo.mode.name()));
- updateState(DaikinBindingConstants.CHANNEL_AIRBASE_AC_FAN_SPEED, new StringType(controlInfo.fanSpeed.name()));
+ updateState(DaikinBindingConstants.CHANNEL_AIRBASE_AC_FAN_SPEED,
+ new StringType(controlInfo.fanSpeed.name()));
if (!controlInfo.power) {
updateState(DaikinBindingConstants.CHANNEL_AC_HOMEKITMODE, new StringType(HomekitMode.OFF.getValue()));
@@ -119,8 +106,9 @@ protected void pollStatus() throws IOException {
AirbaseZoneInfo zoneInfo = webTargets.getAirbaseZoneInfo();
if (zoneInfo != null) {
- IntStream.range(0, zoneInfo.zone.length).forEach(
- idx -> updateState(DaikinBindingConstants.CHANNEL_AIRBASE_AC_ZONE + idx, OnOffType.from(zoneInfo.zone[idx])));
+ IntStream.range(0, zoneInfo.zone.length)
+ .forEach(idx -> updateState(DaikinBindingConstants.CHANNEL_AIRBASE_AC_ZONE + idx,
+ OnOffType.from(zoneInfo.zone[idx])));
}
}
@@ -141,8 +129,8 @@ protected void changeSetPoint(double newTemperature) throws DaikinCommunicationE
@Override
protected void changeMode(String mode) throws DaikinCommunicationException {
AirbaseMode newMode = AirbaseMode.valueOf(mode);
- if ((newMode == AirbaseMode.AUTO && !airbaseModelInfo.features.contains(AirbaseFeature.AUTO)) ||
- (newMode == AirbaseMode.DRY && !airbaseModelInfo.features.contains(AirbaseFeature.DRY))) {
+ if ((newMode == AirbaseMode.AUTO && !airbaseModelInfo.features.contains(AirbaseFeature.AUTO))
+ || (newMode == AirbaseMode.DRY && !airbaseModelInfo.features.contains(AirbaseFeature.DRY))) {
logger.warn("{} mode is not supported by your controller", mode);
return;
}
@@ -154,8 +142,9 @@ protected void changeMode(String mode) throws DaikinCommunicationException {
@Override
protected void changeFanSpeed(String speed) throws DaikinCommunicationException {
AirbaseFanSpeed newFanSpeed = AirbaseFanSpeed.valueOf(speed);
- if (EnumSet.range(AirbaseFanSpeed.AUTO_LEVEL_1, AirbaseFanSpeed.AUTO_LEVEL_5).contains(newFanSpeed) && !airbaseModelInfo.features.contains(AirbaseFeature.FRATE_AUTO)) {
- logger.warn("Auto fan levels are not supported by your controller");
+ if (EnumSet.range(AirbaseFanSpeed.AUTO_LEVEL_1, AirbaseFanSpeed.AUTO_LEVEL_5).contains(newFanSpeed)
+ && !airbaseModelInfo.features.contains(AirbaseFeature.FRATE_AUTO)) {
+ logger.warn("Fan AUTO_LEVEL_X is not supported by your controller");
return;
}
if (newFanSpeed == AirbaseFanSpeed.AIRSIDE && !airbaseModelInfo.features.contains(AirbaseFeature.AIRSIDE)) {
@@ -169,7 +158,8 @@ protected void changeFanSpeed(String speed) throws DaikinCommunicationException
protected void changeZone(int zone, boolean command) throws DaikinCommunicationException {
if (zone <= 0 || zone > airbaseModelInfo.zonespresent) {
- logger.warn("The given zone number ({}) is outside the number of zones supported by the controller ({})", zone, airbaseModelInfo.zonespresent);
+ logger.warn("The given zone number ({}) is outside the number of zones supported by the controller ({})",
+ zone, airbaseModelInfo.zonespresent);
return;
}
AirbaseZoneInfo info = webTargets.getAirbaseZoneInfo();
@@ -184,6 +174,7 @@ protected void updateChannelStateDescriptions() {
protected void updateAirbaseFanSpeedChannelStateDescription() {
List options = new ArrayList<>();
+ options.add(new StateOption(AirbaseFanSpeed.AUTO.name(), AirbaseFanSpeed.AUTO.getLabel()));
if (airbaseModelInfo.features.contains(AirbaseFeature.AIRSIDE)) {
options.add(new StateOption(AirbaseFanSpeed.AIRSIDE.name(), AirbaseFanSpeed.AIRSIDE.getLabel()));
}
@@ -195,8 +186,8 @@ protected void updateAirbaseFanSpeedChannelStateDescription() {
options.add(new StateOption(f.name(), f.getLabel()));
}
}
- stateDescriptionProvider.setStateOptions(new ChannelUID(thing.getUID(), DaikinBindingConstants.CHANNEL_AIRBASE_AC_FAN_SPEED),
- options);
+ stateDescriptionProvider.setStateOptions(
+ new ChannelUID(thing.getUID(), DaikinBindingConstants.CHANNEL_AIRBASE_AC_FAN_SPEED), options);
}
protected void updateAirbaseModeChannelStateDescription() {
diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinBaseHandler.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinBaseHandler.java
index 729b5260644aa..2139b0b307a75 100755
--- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinBaseHandler.java
+++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinBaseHandler.java
@@ -16,10 +16,6 @@
import java.util.Optional;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
-import java.util.stream.IntStream;
-import java.util.EnumSet;
-import java.util.List;
-import java.util.ArrayList;
import javax.measure.quantity.Temperature;
@@ -32,20 +28,18 @@
import org.eclipse.smarthome.core.library.unit.SIUnits;
import org.eclipse.smarthome.core.thing.ChannelUID;
import org.eclipse.smarthome.core.thing.Thing;
-import org.eclipse.smarthome.core.thing.ThingTypeUID;
import org.eclipse.smarthome.core.thing.ThingStatus;
import org.eclipse.smarthome.core.thing.ThingStatusDetail;
+import org.eclipse.smarthome.core.thing.ThingTypeUID;
import org.eclipse.smarthome.core.thing.binding.BaseThingHandler;
import org.eclipse.smarthome.core.types.Command;
import org.eclipse.smarthome.core.types.State;
-import org.eclipse.smarthome.core.types.StateOption;
import org.eclipse.smarthome.core.types.UnDefType;
import org.openhab.binding.daikin.internal.DaikinBindingConstants;
import org.openhab.binding.daikin.internal.DaikinCommunicationException;
-import org.openhab.binding.daikin.internal.DaikinWebTargets;
import org.openhab.binding.daikin.internal.DaikinDynamicStateDescriptionProvider;
+import org.openhab.binding.daikin.internal.DaikinWebTargets;
import org.openhab.binding.daikin.internal.api.Enums.HomekitMode;
-
import org.openhab.binding.daikin.internal.config.DaikinConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -72,13 +66,16 @@ public abstract class DaikinBaseHandler extends BaseThingHandler {
protected abstract void pollStatus() throws IOException;
protected abstract void changePower(boolean power) throws DaikinCommunicationException;
+
protected abstract void changeSetPoint(double newTemperature) throws DaikinCommunicationException;
+
protected abstract void changeMode(String mode) throws DaikinCommunicationException;
- protected abstract void changeFanSpeed(String fanSpeed) throws DaikinCommunicationException;
- // Power, Temp, Fan and Mode are handled in this base class. Override this to handle additional channels.
- protected abstract boolean handleCommandInternal(ChannelUID channelUID, Command command) throws DaikinCommunicationException;
+ protected abstract void changeFanSpeed(String fanSpeed) throws DaikinCommunicationException;
+ // Power, Temp, Fan and Mode are handled in this base class. Override this to handle additional channels.
+ protected abstract boolean handleCommandInternal(ChannelUID channelUID, Command command)
+ throws DaikinCommunicationException;
public DaikinBaseHandler(Thing thing, DaikinDynamicStateDescriptionProvider stateDescriptionProvider) {
super(thing);
@@ -123,7 +120,8 @@ public void handleCommand(ChannelUID channelUID, Command command) {
}
break;
}
- logger.debug("Received command ({}) of wrong type for thing '{}' on channel {}", command, thing.getUID().getAsString(), channelUID.getId());
+ logger.debug("Received command ({}) of wrong type for thing '{}' on channel {}", command,
+ thing.getUID().getAsString(), channelUID.getId());
} catch (DaikinCommunicationException ex) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, ex.getMessage());
}
@@ -182,9 +180,8 @@ private synchronized void poll() {
}
protected void updateTemperatureChannel(String channel, Optional maybeTemperature) {
- updateState(channel,
- maybeTemperature. map(t -> new QuantityType(new DecimalType(t), SIUnits.CELSIUS))
- .orElse(UnDefType.UNDEF));
+ updateState(channel, maybeTemperature. map(t -> new QuantityType<>(new DecimalType(t), SIUnits.CELSIUS))
+ .orElse(UnDefType.UNDEF));
}
/**
@@ -209,16 +206,16 @@ private boolean changeSetPoint(Command command) throws DaikinCommunicationExcept
private void changeHomekitMode(String homekitmode) throws DaikinCommunicationException {
ThingTypeUID thingTypeUID = thing.getThingTypeUID();
if (HomekitMode.OFF.getValue().equals(homekitmode)) {
- changePower(false);
+ changePower(false);
} else {
- changePower(true);
- if (HomekitMode.AUTO.getValue().equals(homekitmode)) {
+ changePower(true);
+ if (HomekitMode.AUTO.getValue().equals(homekitmode)) {
changeMode("AUTO");
- } else if (HomekitMode.HEAT.getValue().equals(homekitmode)) {
+ } else if (HomekitMode.HEAT.getValue().equals(homekitmode)) {
changeMode("HEAT");
- } else if (HomekitMode.COOL.getValue().equals(homekitmode)) {
+ } else if (HomekitMode.COOL.getValue().equals(homekitmode)) {
changeMode("COLD");
- }
+ }
}
}
diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/SensorThingHandler.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/SensorThingHandler.java
index afa468e54245a..d0fec3e8cd27b 100644
--- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/SensorThingHandler.java
+++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/SensorThingHandler.java
@@ -31,15 +31,6 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-import javax.measure.quantity.Dimensionless;
-import javax.measure.quantity.ElectricCurrent;
-import javax.measure.quantity.ElectricPotential;
-import javax.measure.quantity.Energy;
-import javax.measure.quantity.Illuminance;
-import javax.measure.quantity.Power;
-import javax.measure.quantity.Pressure;
-import javax.measure.quantity.Temperature;
-
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.smarthome.core.library.types.DateTimeType;
@@ -357,7 +348,7 @@ public void valueUpdated(ChannelUID channelUID, SensorConfig newConfig) {
break;
case CHANNEL_TEMPERATURE:
if (temperature != null) {
- updateState(channelUID, new QuantityType(temperature / 100, CELSIUS));
+ updateState(channelUID, new QuantityType<>(temperature / 100, CELSIUS));
}
break;
}
@@ -400,27 +391,27 @@ public void valueUpdated(ChannelUID channelUID, SensorState newState, boolean in
break;
case CHANNEL_POWER:
if (power != null) {
- updateState(channelUID, new QuantityType(power, WATT));
+ updateState(channelUID, new QuantityType<>(power, WATT));
}
break;
case CHANNEL_CONSUMPTION:
if (consumption != null) {
- updateState(channelUID, new QuantityType(consumption, WATT_HOUR));
+ updateState(channelUID, new QuantityType<>(consumption, WATT_HOUR));
}
break;
case CHANNEL_VOLTAGE:
if (voltage != null) {
- updateState(channelUID, new QuantityType(voltage, VOLT));
+ updateState(channelUID, new QuantityType<>(voltage, VOLT));
}
break;
case CHANNEL_CURRENT:
if (current != null) {
- updateState(channelUID, new QuantityType(current, MILLI(AMPERE)));
+ updateState(channelUID, new QuantityType<>(current, MILLI(AMPERE)));
}
break;
case CHANNEL_LIGHT_LUX:
if (lux != null) {
- updateState(channelUID, new QuantityType(lux, LUX));
+ updateState(channelUID, new QuantityType<>(lux, LUX));
}
break;
case CHANNEL_LIGHT_LEVEL:
@@ -436,17 +427,17 @@ public void valueUpdated(ChannelUID channelUID, SensorState newState, boolean in
break;
case CHANNEL_TEMPERATURE:
if (temperature != null) {
- updateState(channelUID, new QuantityType(temperature / 100, CELSIUS));
+ updateState(channelUID, new QuantityType<>(temperature / 100, CELSIUS));
}
break;
case CHANNEL_HUMIDITY:
if (humidity != null) {
- updateState(channelUID, new QuantityType(humidity / 100, PERCENT));
+ updateState(channelUID, new QuantityType<>(humidity / 100, PERCENT));
}
break;
case CHANNEL_PRESSURE:
if (pressure != null) {
- updateState(channelUID, new QuantityType(pressure, HECTO(PASCAL)));
+ updateState(channelUID, new QuantityType<>(pressure, HECTO(PASCAL)));
}
break;
case CHANNEL_PRESENCE:
diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzBindingConstants.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzBindingConstants.java
index 99f42e01d666a..7660d20df8e29 100644
--- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzBindingConstants.java
+++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzBindingConstants.java
@@ -15,6 +15,7 @@
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.LinkedHashMap;
+import java.util.Map;
import org.eclipse.smarthome.core.thing.ThingTypeUID;
import org.eclipse.smarthome.core.thing.type.ChannelTypeUID;
@@ -72,8 +73,8 @@ public class DenonMarantzBindingConstants {
public static final String CHANNEL_ZONE4_MUTE = "zone4#mute";
public static final String CHANNEL_ZONE4_INPUT = "zone4#input";
- // HashMap of Zone2 Channel Type UIDs (to be added to Thing later when needed)
- public static final LinkedHashMap ZONE2_CHANNEL_TYPES = new LinkedHashMap();
+ // Map of Zone2 Channel Type UIDs (to be added to Thing later when needed)
+ public static final Map ZONE2_CHANNEL_TYPES = new LinkedHashMap<>();
static {
ZONE2_CHANNEL_TYPES.put(CHANNEL_ZONE2_POWER, new ChannelTypeUID(BINDING_ID, "zonePower"));
ZONE2_CHANNEL_TYPES.put(CHANNEL_ZONE2_VOLUME, new ChannelTypeUID(BINDING_ID, "volume"));
@@ -82,8 +83,8 @@ public class DenonMarantzBindingConstants {
ZONE2_CHANNEL_TYPES.put(CHANNEL_ZONE2_INPUT, new ChannelTypeUID(BINDING_ID, "input"));
}
- // HashMap of Zone3 Channel Type UIDs (to be added to Thing later when needed)
- public static final LinkedHashMap ZONE3_CHANNEL_TYPES = new LinkedHashMap();
+ // Map of Zone3 Channel Type UIDs (to be added to Thing later when needed)
+ public static final Map ZONE3_CHANNEL_TYPES = new LinkedHashMap<>();
static {
ZONE3_CHANNEL_TYPES.put(CHANNEL_ZONE3_POWER, new ChannelTypeUID(BINDING_ID, "zonePower"));
ZONE3_CHANNEL_TYPES.put(CHANNEL_ZONE3_VOLUME, new ChannelTypeUID(BINDING_ID, "volume"));
@@ -92,8 +93,8 @@ public class DenonMarantzBindingConstants {
ZONE3_CHANNEL_TYPES.put(CHANNEL_ZONE3_INPUT, new ChannelTypeUID(BINDING_ID, "input"));
}
- // HashMap of Zone4 Channel Type UIDs (to be added to Thing later when needed)
- public static final LinkedHashMap ZONE4_CHANNEL_TYPES = new LinkedHashMap();
+ // Map of Zone4 Channel Type UIDs (to be added to Thing later when needed)
+ public static final Map ZONE4_CHANNEL_TYPES = new LinkedHashMap<>();
static {
ZONE4_CHANNEL_TYPES.put(CHANNEL_ZONE4_POWER, new ChannelTypeUID(BINDING_ID, "zonePower"));
ZONE4_CHANNEL_TYPES.put(CHANNEL_ZONE4_VOLUME, new ChannelTypeUID(BINDING_ID, "volume"));
@@ -108,7 +109,7 @@ public class DenonMarantzBindingConstants {
* thing-types.xml)
* See https://github.com/eclipse/smarthome/pull/4787#issuecomment-362287430
*/
- public static final HashMap CHANNEL_ITEM_TYPES = new HashMap();
+ public static final Map CHANNEL_ITEM_TYPES = new HashMap<>();
static {
CHANNEL_ITEM_TYPES.put(CHANNEL_ZONE2_POWER, "Switch");
CHANNEL_ITEM_TYPES.put(CHANNEL_ZONE2_VOLUME, "Dimmer");
diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/telnet/DenonMarantzTelnetConnector.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/telnet/DenonMarantzTelnetConnector.java
index c4a534de656f7..b5ae903f13639 100644
--- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/telnet/DenonMarantzTelnetConnector.java
+++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/telnet/DenonMarantzTelnetConnector.java
@@ -15,6 +15,7 @@
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.List;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.regex.Pattern;
@@ -106,7 +107,7 @@ public void dispose() {
private void refreshState() {
// Sends a series of state query commands over the telnet connection
telnetStateRequest = scheduler.submit(() -> {
- ArrayList cmds = new ArrayList(Arrays.asList("PW?", "MS?", "MV?", "ZM?", "MU?", "SI?"));
+ List cmds = new ArrayList<>(Arrays.asList("PW?", "MS?", "MV?", "ZM?", "MU?", "SI?"));
if (config.getZoneCount() > 1) {
cmds.add("Z2?");
cmds.add("Z2MU?");
diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/AppCommandRequest.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/AppCommandRequest.java
index 40a6d42f37f37..51754b86d047f 100644
--- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/AppCommandRequest.java
+++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/AppCommandRequest.java
@@ -30,7 +30,7 @@
public class AppCommandRequest {
@XmlElement(name = "cmd")
- private List commands = new ArrayList();
+ private List commands = new ArrayList<>();
public AppCommandRequest() {
}
diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/AppCommandResponse.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/AppCommandResponse.java
index 34127e6d6a8e8..a3c6bee81837d 100644
--- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/AppCommandResponse.java
+++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/AppCommandResponse.java
@@ -30,7 +30,7 @@
public class AppCommandResponse {
@XmlElement(name = "cmd")
- private List commands = new ArrayList();
+ private List commands = new ArrayList<>();
public AppCommandResponse() {
}
diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/CommandRx.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/CommandRx.java
index 9280e57e1fd67..dc3af4312c3a5 100644
--- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/CommandRx.java
+++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/CommandRx.java
@@ -49,7 +49,7 @@ public class CommandRx {
private String type;
@XmlElement(name = "text")
- private List texts = new ArrayList();
+ private List texts = new ArrayList<>();
@XmlElementWrapper(name = "functionrename")
@XmlElement(name = "list")
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/DigitalSTROMHandlerFactory.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/DigitalSTROMHandlerFactory.java
index c1f3e2cdda757..f7df4a7029760 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/DigitalSTROMHandlerFactory.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/DigitalSTROMHandlerFactory.java
@@ -50,9 +50,9 @@
public class DigitalSTROMHandlerFactory extends BaseThingHandlerFactory {
private final Logger logger = LoggerFactory.getLogger(DigitalSTROMHandlerFactory.class);
- private final HashMap discoveryServiceManagers = new HashMap();
+ private final Map discoveryServiceManagers = new HashMap<>();
- private HashMap bridgeHandlers;
+ private Map bridgeHandlers;
@Override
public boolean supportsThingType(ThingTypeUID thingTypeUID) {
@@ -109,7 +109,7 @@ protected ThingHandler createHandler(Thing thing) {
if (BridgeHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) {
BridgeHandler handler = new BridgeHandler((Bridge) thing);
if (bridgeHandlers == null) {
- bridgeHandlers = new HashMap();
+ bridgeHandlers = new HashMap<>();
}
bridgeHandlers.put(thing.getUID(), handler);
DiscoveryServiceManager discoveryServiceManager = new DiscoveryServiceManager(handler);
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/DiscoveryServiceManager.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/DiscoveryServiceManager.java
index e721edfc1fd7d..6ab6142bd2ef3 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/DiscoveryServiceManager.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/DiscoveryServiceManager.java
@@ -19,6 +19,7 @@
import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService;
import org.eclipse.smarthome.config.discovery.DiscoveryService;
import org.eclipse.smarthome.core.thing.ThingTypeUID;
+import org.eclipse.smarthome.core.thing.type.ThingType;
import org.openhab.binding.digitalstrom.internal.DigitalSTROMBindingConstants;
import org.openhab.binding.digitalstrom.internal.handler.BridgeHandler;
import org.openhab.binding.digitalstrom.internal.handler.CircuitHandler;
@@ -50,7 +51,7 @@
public class DiscoveryServiceManager
implements SceneStatusListener, DeviceStatusListener, TemperatureControlStatusListener {
- private final HashMap discoveryServices;
+ private final Map discoveryServices;
private final Map> discoveryServiceRegs = new HashMap<>();
private final String bridgeUID;
@@ -63,7 +64,7 @@ public class DiscoveryServiceManager
*/
public DiscoveryServiceManager(BridgeHandler bridgeHandler) {
bridgeUID = bridgeHandler.getThing().getUID().getAsString();
- discoveryServices = new HashMap(SceneHandler.SUPPORTED_THING_TYPES.size()
+ discoveryServices = new HashMap<>(SceneHandler.SUPPORTED_THING_TYPES.size()
+ DeviceHandler.SUPPORTED_THING_TYPES.size() + CircuitHandler.SUPPORTED_THING_TYPES.size()
+ ZoneTemperatureControlHandler.SUPPORTED_THING_TYPES.size());
for (ThingTypeUID type : SceneHandler.SUPPORTED_THING_TYPES) {
@@ -127,20 +128,17 @@ public void registerDiscoveryServices(BundleContext bundleContext) {
if (discoveryServices != null) {
for (AbstractDiscoveryService service : discoveryServices.values()) {
if (service instanceof SceneDiscoveryService) {
- this.discoveryServiceRegs.put(bridgeUID + ((SceneDiscoveryService) service).getID(),
- bundleContext.registerService(DiscoveryService.class.getName(), service,
- new Hashtable()));
+ this.discoveryServiceRegs.put(bridgeUID + ((SceneDiscoveryService) service).getID(), bundleContext
+ .registerService(DiscoveryService.class.getName(), service, new Hashtable<>()));
}
if (service instanceof DeviceDiscoveryService) {
- this.discoveryServiceRegs.put(bridgeUID + ((DeviceDiscoveryService) service).getID(),
- bundleContext.registerService(DiscoveryService.class.getName(), service,
- new Hashtable()));
+ this.discoveryServiceRegs.put(bridgeUID + ((DeviceDiscoveryService) service).getID(), bundleContext
+ .registerService(DiscoveryService.class.getName(), service, new Hashtable<>()));
}
if (service instanceof ZoneTemperatureControlDiscoveryService) {
- this.discoveryServiceRegs.put(
- bridgeUID + ((ZoneTemperatureControlDiscoveryService) service).getID(),
- bundleContext.registerService(DiscoveryService.class.getName(), service,
- new Hashtable()));
+ this.discoveryServiceRegs
+ .put(bridgeUID + ((ZoneTemperatureControlDiscoveryService) service).getID(), bundleContext
+ .registerService(DiscoveryService.class.getName(), service, new Hashtable<>()));
}
}
}
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/BridgeHandler.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/BridgeHandler.java
index c51c2539001d6..40e308dc3d1b1 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/BridgeHandler.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/BridgeHandler.java
@@ -251,7 +251,7 @@ private Config loadAndCheckConfig() {
return null;
}
logger.debug("Loading configuration");
- ArrayList numberExc = new ArrayList();
+ List numberExc = new ArrayList<>();
// Parameters can't be null, because of an existing default value.
if (thingConfig.get(DigitalSTROMBindingConstants.SENSOR_DATA_UPDATE_INTERVAL) instanceof BigDecimal) {
config.setSensordataRefreshInterval(
@@ -683,7 +683,7 @@ public void onConnectionStateChange(String newConnectionState, String reason) {
*/
public List getDevices() {
return this.structMan != null && this.structMan.getDeviceMap() != null
- ? new LinkedList(this.structMan.getDeviceMap().values())
+ ? new LinkedList<>(this.structMan.getDeviceMap().values())
: null;
}
@@ -728,7 +728,7 @@ public void sendComandsToDSS(Device device, DeviceStateUpdate deviceStateUpdate)
* @return Scene list (cannot be null)
*/
public List getScenes() {
- return sceneMan != null ? sceneMan.getScenes() : new LinkedList();
+ return sceneMan != null ? sceneMan.getScenes() : new LinkedList<>();
}
/**
@@ -792,7 +792,7 @@ public void onStatusChanged(ManagerTypes managerType, ManagerStates state) {
public List getCircuits() {
logger.debug("circuits: {}", structMan.getCircuitMap().values().toString());
return structMan != null && structMan.getCircuitMap() != null
- ? new LinkedList(structMan.getCircuitMap().values())
+ ? new LinkedList<>(structMan.getCircuitMap().values())
: null;
}
@@ -838,7 +838,6 @@ public void unregisterTemperatureControlStatusListener(
* @return all temperature control status objects
*/
public Collection getTemperatureControlStatusFromAllZones() {
- return tempContMan != null ? tempContMan.getTemperatureControlStatusFromAllZones()
- : new LinkedList();
+ return tempContMan != null ? tempContMan.getTemperatureControlStatusFromAllZones() : new LinkedList<>();
}
}
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/CircuitHandler.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/CircuitHandler.java
index e82a5a82f12e1..aa546efe28354 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/CircuitHandler.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/CircuitHandler.java
@@ -59,7 +59,7 @@ public class CircuitHandler extends BaseThingHandler implements DeviceStatusList
/**
* Contains all supported thing types of this handler, will be filled by DsDeviceThingTypeProvider.
*/
- public static final Set SUPPORTED_THING_TYPES = new HashSet();
+ public static final Set SUPPORTED_THING_TYPES = new HashSet<>();
private String dSID;
private Circuit circuit;
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/DeviceHandler.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/DeviceHandler.java
index f6aca36cc2233..26acb664207db 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/DeviceHandler.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/DeviceHandler.java
@@ -83,7 +83,7 @@ public class DeviceHandler extends BaseThingHandler implements DeviceStatusListe
/**
* Contains all supported thing types of this handler, will be filled by DsDeviceThingTypeProvider.
*/
- public static final Set SUPPORTED_THING_TYPES = new HashSet();
+ public static final Set SUPPORTED_THING_TYPES = new HashSet<>();
public static final String TWO_STAGE_SWITCH_IDENTICATOR = "2";
public static final String THREE_STAGE_SWITCH_IDENTICATOR = "3";
@@ -527,7 +527,7 @@ private void checkDeviceInfoProperties(Device device) {
}
private String getBinarayInputList() {
- List binarayInputs = new ArrayList(device.getBinaryInputs().size());
+ List binarayInputs = new ArrayList<>(device.getBinaryInputs().size());
for (DeviceBinaryInput binInput : device.getBinaryInputs()) {
DeviceBinarayInputEnum devBinInp = DeviceBinarayInputEnum.getdeviceBinarayInput(binInput.getInputType());
if (devBinInp != null) {
@@ -592,7 +592,7 @@ private void loadSensorChannels() {
private boolean addLoadedSensorChannel(String sensorChannelType) {
if (loadedSensorChannels == null) {
- loadedSensorChannels = new LinkedList();
+ loadedSensorChannels = new LinkedList<>();
}
if (!loadedSensorChannels.contains(sensorChannelType.toString())) {
return loadedSensorChannels.add(sensorChannelType.toString());
@@ -615,7 +615,7 @@ private boolean isSensorChannelLoaded(String sensorChannelType) {
}
private void checkSensorChannel() {
- List channelList = new LinkedList(this.getThing().getChannels());
+ List channelList = new LinkedList<>(this.getThing().getChannels());
boolean channelListChanged = false;
@@ -732,7 +732,7 @@ private void loadOutputChannel(ChannelTypeUID channelTypeUID, String acceptedIte
}
currentChannel = channelTypeUID.getId();
- List channelList = new LinkedList(this.getThing().getChannels());
+ List channelList = new LinkedList<>(this.getThing().getChannels());
boolean channelIsAlreadyLoaded = false;
boolean channelListChanged = false;
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/ZoneTemperatureControlHandler.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/ZoneTemperatureControlHandler.java
index 36f03b09da645..bc52eaa28a895 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/ZoneTemperatureControlHandler.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/ZoneTemperatureControlHandler.java
@@ -47,6 +47,7 @@
import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.TemperatureControlStatus;
import org.openhab.binding.digitalstrom.internal.lib.listener.TemperatureControlStatusListener;
import org.openhab.binding.digitalstrom.internal.lib.manager.StructureManager;
+import org.openhab.binding.digitalstrom.internal.lib.manager.impl.TemperatureControlManager;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.FunctionalColorGroupEnum;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.OutputModeEnum;
import org.openhab.binding.digitalstrom.internal.providers.DsChannelTypeProvider;
@@ -312,7 +313,7 @@ public synchronized void configChanged(TemperatureControlStatus tempControlStatu
}
private synchronized void loadChannel() {
- List newChannelList = new ArrayList(1);
+ List newChannelList = new ArrayList<>(1);
if (currentChannelID != null) {
newChannelList.add(ChannelBuilder
.create(new ChannelUID(this.getThing().getUID(), currentChannelID),
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/BaseSensorValues.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/BaseSensorValues.java
index 4c4656c5a959b..c9d08af3cd770 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/BaseSensorValues.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/BaseSensorValues.java
@@ -75,7 +75,7 @@ protected void addSensorValue(JsonObject jObject, boolean outdoor) {
private void addSensorValue(CachedSensorValue cachedSensorValue) {
if (sensorValues == null) {
- sensorValues = new LinkedList();
+ sensorValues = new LinkedList<>();
sensorValues.add(cachedSensorValue);
} else {
sensorValues.add(cachedSensorValue);
@@ -88,7 +88,7 @@ private void addSensorValue(CachedSensorValue cachedSensorValue) {
* @return available sensor types
*/
public List getAvailableSensorTypes() {
- List sensorTypes = new LinkedList();
+ List sensorTypes = new LinkedList<>();
if (sensorValues != null) {
for (CachedSensorValue cSensorValue : sensorValues) {
sensorTypes.add(cSensorValue.getSensorType());
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/AssignedSensors.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/AssignedSensors.java
index 3b7896d8d1e28..398bcff565d3d 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/AssignedSensors.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/AssignedSensors.java
@@ -65,7 +65,7 @@ private void init(JsonObject jObject) {
&& jObject.get(JSONApiResponseKeysEnum.SENSORS.getKey()).isJsonArray()) {
JsonArray jArray = jObject.get(JSONApiResponseKeysEnum.SENSORS.getKey()).getAsJsonArray();
if (jArray.size() != 0) {
- sensors = new LinkedList();
+ sensors = new LinkedList<>();
Iterator iter = jArray.iterator();
while (iter.hasNext()) {
JsonObject assignedSensor = iter.next().getAsJsonObject();
@@ -90,7 +90,7 @@ private void init(JsonObject jObject) {
* @return list of all assigned sensor types
*/
public List getAssignedZoneSensorTypes() {
- List sensorTypes = new LinkedList();
+ List sensorTypes = new LinkedList<>();
if (sensors != null) {
for (AssignSensorType aSensorValue : sensors) {
sensorTypes.add(aSensorValue.getSensorType());
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlValues.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlValues.java
index 6828d026ae11e..789f619bdb1b0 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlValues.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlValues.java
@@ -13,6 +13,7 @@
package org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl;
import java.util.HashMap;
+import java.util.Map;
import java.util.Set;
import org.openhab.binding.digitalstrom.internal.lib.climate.constants.OperationModes;
@@ -31,7 +32,7 @@
*/
public class TemperatureControlValues extends BaseZoneIdentifier {
- private HashMap temperatureControlValues;
+ private Map temperatureControlValues;
private String controlDSUID;
private Boolean isConfigured;
@@ -69,7 +70,7 @@ private void init(JsonObject jObject) {
if (jObject.get(JSONApiResponseKeysEnum.CONTROL_DSUID.getKey()) != null) {
this.controlDSUID = jObject.get(JSONApiResponseKeysEnum.CONTROL_DSUID.getKey()).getAsString();
}
- temperatureControlValues = new HashMap(OperationModes.values().length);
+ temperatureControlValues = new HashMap<>(OperationModes.values().length);
for (OperationModes opMode : OperationModes.values()) {
if (jObject.get(opMode.getKey()) != null) {
temperatureControlValues.put(opMode, jObject.get(opMode.getKey()).getAsFloat());
@@ -114,11 +115,11 @@ public Set getOperationModes() {
}
/**
- * Returns a {@link HashMap} that maps the available operation modes to the set values.
+ * Returns a {@link Map} that maps the available operation modes to the set values.
*
- * @return HashMap with operation modes and their values
+ * @return Map with operation modes and their values
*/
- public HashMap getTemperatureControlValues() {
+ public Map getTemperatureControlValues() {
return temperatureControlValues;
}
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/EventListener.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/EventListener.java
index c71b017da35b0..8e113d2c09954 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/EventListener.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/EventListener.java
@@ -65,7 +65,7 @@ public class EventListener {
private int subscriptionID = 15;
private final int timeout = 500;
- private final List subscribedEvents = Collections.synchronizedList(new LinkedList());
+ private final List subscribedEvents = Collections.synchronizedList(new LinkedList<>());
private boolean subscribed = false;
// error message
@@ -74,7 +74,7 @@ public class EventListener {
// found."
private final ConnectionManager connManager;
- private final List eventHandlers = Collections.synchronizedList(new LinkedList());
+ private final List eventHandlers = Collections.synchronizedList(new LinkedList<>());
private final Config config;
private boolean isStarted = false;
@@ -218,7 +218,7 @@ public void addEventHandler(EventHandler eventHandler) {
*/
public void removeEventHandler(EventHandler eventHandler) {
if (eventHandler != null && eventHandlers.contains(eventHandler)) {
- List tempSubsList = new ArrayList();
+ List tempSubsList = new ArrayList<>();
int index = -1;
EventHandler intEventHandler = null;
boolean subscribedEventsChanged = false;
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/constants/EventResponseEnum.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/constants/EventResponseEnum.java
index ff4b747b6885f..fff08a85728f1 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/constants/EventResponseEnum.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/constants/EventResponseEnum.java
@@ -13,6 +13,7 @@
package org.openhab.binding.digitalstrom.internal.lib.event.constants;
import java.util.HashMap;
+import java.util.Map;
/**
* The {@link EventResponseEnum} contains digitalSTROM-Event properties of the events at {@link EventNames}.
@@ -66,7 +67,7 @@ public enum EventResponseEnum {
INPUT_INDEX("inputIndex");
private final String id;
- static final HashMap EVENT_RESPONSE_FIELDS = new HashMap();
+ static final Map EVENT_RESPONSE_FIELDS = new HashMap<>();
static {
for (EventResponseEnum ev : EventResponseEnum.values()) {
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/EventItemImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/EventItemImpl.java
index b29eab5b923cd..cac8870c7356e 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/EventItemImpl.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/EventItemImpl.java
@@ -15,12 +15,11 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.Set;
import org.openhab.binding.digitalstrom.internal.lib.event.constants.EventResponseEnum;
import org.openhab.binding.digitalstrom.internal.lib.serverconnection.constants.JSONApiResponseKeysEnum;
-import java.util.Set;
-
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
@@ -47,7 +46,7 @@ public EventItemImpl(JsonObject jsonEventItem) {
if (jsonEventItem.get(JSONApiResponseKeysEnum.PROPERTIES.getKey()).isJsonObject()) {
Set> propObjEntrySet = jsonEventItem
.get(JSONApiResponseKeysEnum.PROPERTIES.getKey()).getAsJsonObject().entrySet();
- properties = new HashMap(propObjEntrySet.size());
+ properties = new HashMap<>(propObjEntrySet.size());
for (Entry entry : propObjEntrySet) {
if (EventResponseEnum.containsId(entry.getKey())) {
addProperty(EventResponseEnum.getProperty(entry.getKey()), entry.getValue().getAsString());
@@ -57,7 +56,7 @@ public EventItemImpl(JsonObject jsonEventItem) {
if (jsonEventItem.get(JSONApiResponseKeysEnum.SOURCE.getKey()).isJsonObject()) {
Set> sourceObjEntrySet = jsonEventItem
.get(JSONApiResponseKeysEnum.SOURCE.getKey()).getAsJsonObject().entrySet();
- source = new HashMap(sourceObjEntrySet.size());
+ source = new HashMap<>(sourceObjEntrySet.size());
for (Entry entry : sourceObjEntrySet) {
if (EventResponseEnum.containsId(entry.getKey())) {
addSource(EventResponseEnum.getProperty(entry.getKey()), entry.getValue().getAsString());
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/JSONEventImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/JSONEventImpl.java
index e11595e87c21c..c232ea6471dcc 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/JSONEventImpl.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/JSONEventImpl.java
@@ -33,7 +33,7 @@ public class JSONEventImpl implements Event {
* @param jsonEventArray must not be null
*/
public JSONEventImpl(JsonArray jsonEventArray) {
- this.eventItemList = new LinkedList();
+ this.eventItemList = new LinkedList<>();
for (int i = 0; i < jsonEventArray.size(); i++) {
if (jsonEventArray.get(i) instanceof JsonObject) {
this.eventItemList.add(new EventItemImpl((JsonObject) jsonEventArray.get(i)));
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/StructureManager.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/StructureManager.java
index 58f781fe5c632..5602a8e024905 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/StructureManager.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/StructureManager.java
@@ -12,7 +12,6 @@
*/
package org.openhab.binding.digitalstrom.internal.lib.manager;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -94,12 +93,12 @@ public interface StructureManager {
Map getDeviceHashMapReference();
/**
- * Returns the reference of the structure as {@link Map}[zoneID, {@link HashMap}[groupID,
+ * Returns the reference of the structure as {@link Map}[zoneID, {@link Map}[groupID,
* {@link List}[{@link Device}]]].
*
* @return structure reference
*/
- Map>> getStructureReference();
+ Map>> getStructureReference();
/**
* Returns the Map of all groups as format HashMap[Short, List[Device]].
@@ -107,7 +106,7 @@ public interface StructureManager {
* @param zoneID of the zone
* @return groups
*/
- HashMap> getGroupsFromZoneX(int zoneID);
+ Map> getGroupsFromZoneX(int zoneID);
/**
* Returns the reference {@link List} of the {@link Device}'s of an zone-group.
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/DeviceStatusManagerImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/DeviceStatusManagerImpl.java
index 791e6b43d0fc1..f28cf9ec5a8ed 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/DeviceStatusManagerImpl.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/DeviceStatusManagerImpl.java
@@ -17,6 +17,7 @@
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
@@ -112,7 +113,7 @@ public class DeviceStatusManagerImpl implements DeviceStatusManager {
private SceneReadingJobExecutor sceneJobExecutor;
private EventListener eventListener;
- private final List trashDevices = new LinkedList();
+ private final List trashDevices = new LinkedList<>();
private long lastBinCheck = 0;
private ManagerStates state = ManagerStates.STOPPED;
@@ -244,11 +245,11 @@ public void run() {
stateChanged(ManagerStates.INITIALIZING);
}
}
- HashMap tempDeviceMap;
+ Map tempDeviceMap;
if (strucMan.getDeviceMap() != null) {
- tempDeviceMap = (HashMap) strucMan.getDeviceMap();
+ tempDeviceMap = strucMan.getDeviceMap();
} else {
- tempDeviceMap = new HashMap();
+ tempDeviceMap = new HashMap<>();
}
List currentDeviceList = getDetailedDevices();
@@ -403,7 +404,7 @@ public void run() {
}
private List getDetailedDevices() {
- List deviceList = new LinkedList();
+ List deviceList = new LinkedList<>();
JsonObject result = connMan.getDigitalSTROMAPI().query2(connMan.getSessionToken(), GET_DETAILD_DEVICES);
if (result != null && result.isJsonObject()) {
if (result.getAsJsonObject().get(GeneralLibConstance.QUERY_BROADCAST_ZONE_STRING).isJsonObject()) {
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/SceneManagerImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/SceneManagerImpl.java
index 1334e664e4457..247eeee541644 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/SceneManagerImpl.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/SceneManagerImpl.java
@@ -54,9 +54,8 @@ public class SceneManagerImpl implements SceneManager {
private final Logger logger = LoggerFactory.getLogger(SceneManagerImpl.class);
- private final List echoBox = Collections.synchronizedList(new LinkedList());
- private final Map internalSceneMap = Collections
- .synchronizedMap(new HashMap());
+ private final List echoBox = Collections.synchronizedList(new LinkedList<>());
+ private final Map internalSceneMap = Collections.synchronizedMap(new HashMap<>());
private EventListener eventListener;
private final StructureManager structureManager;
@@ -507,7 +506,7 @@ public synchronized ManagerStates getManagerState() {
@Override
public List getScenes() {
- return this.internalSceneMap != null ? new LinkedList(this.internalSceneMap.values()) : null;
+ return this.internalSceneMap != null ? new LinkedList<>(this.internalSceneMap.values()) : null;
}
@Override
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/StructureManagerImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/StructureManagerImpl.java
index 5fca6688aa1e1..549fb25efc2c4 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/StructureManagerImpl.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/StructureManagerImpl.java
@@ -21,6 +21,7 @@
import org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager;
import org.openhab.binding.digitalstrom.internal.lib.manager.StructureManager;
+import org.openhab.binding.digitalstrom.internal.lib.serverconnection.DsAPI;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.AbstractGeneralDeviceInformations;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.Circuit;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.Device;
@@ -75,11 +76,11 @@ public short getGroupID(String groupName) {
*/
public static final String ZONE_GROUP_NAMES = "/apartment/zones/*(ZoneID,name)/groups/*(group,name)";
- private final Map>> zoneGroupDeviceMap = Collections
- .synchronizedMap(new HashMap>>());
- private final Map deviceMap = Collections.synchronizedMap(new HashMap());
- private final Map circuitMap = Collections.synchronizedMap(new HashMap());
- private final Map dSUIDToDSIDMap = Collections.synchronizedMap(new HashMap());
+ private final Map>> zoneGroupDeviceMap = Collections
+ .synchronizedMap(new HashMap<>());
+ private final Map deviceMap = Collections.synchronizedMap(new HashMap<>());
+ private final Map circuitMap = Collections.synchronizedMap(new HashMap<>());
+ private final Map dSUIDToDSIDMap = Collections.synchronizedMap(new HashMap<>());
private Map zoneGroupIdNameMap;
private Map zoneGroupNameIdMap;
@@ -118,8 +119,8 @@ public boolean generateZoneGroupNames(ConnectionManager connectionManager) {
if (resultJsonObj != null && resultJsonObj.get("zones") instanceof JsonArray) {
JsonArray zones = (JsonArray) resultJsonObj.get("zones");
if (zoneGroupIdNameMap == null) {
- zoneGroupIdNameMap = new HashMap(zones.size());
- zoneGroupNameIdMap = new HashMap(zones.size());
+ zoneGroupIdNameMap = new HashMap<>(zones.size());
+ zoneGroupNameIdMap = new HashMap<>(zones.size());
}
if (zones != null) {
for (int i = 0; i < zones.size(); i++) {
@@ -172,7 +173,7 @@ public boolean checkZoneID(int zoneID) {
@Override
public boolean checkZoneGroupID(int zoneID, short groupID) {
- final HashMap> tmp = getGroupsFromZoneX(zoneID);
+ final Map> tmp = getGroupsFromZoneX(zoneID);
return tmp != null ? tmp.get(groupID) != null : false;
}
@@ -187,7 +188,7 @@ public short getZoneGroupId(String zoneName, String groupName) {
@Override
public Map getDeviceMap() {
- return new HashMap(deviceMap);
+ return new HashMap<>(deviceMap);
}
private void putDeviceToHashMap(Device device) {
@@ -205,7 +206,7 @@ private void putDeviceToHashMap(Device device) {
* Note: the zone id 0 is the broadcast address and the group id 0, too.
*/
private void handleStructure(List deviceList) {
- HashMap> groupXHashMap = new HashMap>();
+ Map> groupXHashMap = new HashMap<>();
groupXHashMap.put((short) 0, deviceList);
zoneGroupDeviceMap.put(0, groupXHashMap);
@@ -221,18 +222,18 @@ public Map getDeviceHashMapReference() {
}
@Override
- public Map>> getStructureReference() {
+ public Map>> getStructureReference() {
return zoneGroupDeviceMap;
}
@Override
- public HashMap> getGroupsFromZoneX(int zoneID) {
+ public Map> getGroupsFromZoneX(int zoneID) {
return zoneGroupDeviceMap.get(zoneID);
}
@Override
public List getReferenceDeviceListFromZoneXGroupX(int zoneID, short groupID) {
- final HashMap> tmp = getGroupsFromZoneX(zoneID);
+ final Map> tmp = getGroupsFromZoneX(zoneID);
return tmp != null ? tmp.get(groupID) : null;
}
@@ -336,14 +337,14 @@ public void addDeviceToStructure(Device device) {
}
private void addDevicetoZoneXGroupX(int zoneID, short groupID, Device device) {
- HashMap> groupXHashMap = zoneGroupDeviceMap.get(zoneID);
+ Map> groupXHashMap = zoneGroupDeviceMap.get(zoneID);
if (groupXHashMap == null) {
- groupXHashMap = new HashMap>();
+ groupXHashMap = new HashMap<>();
zoneGroupDeviceMap.put(zoneID, groupXHashMap);
}
List groupDeviceList = groupXHashMap.get(groupID);
if (groupDeviceList == null) {
- groupDeviceList = new LinkedList();
+ groupDeviceList = new LinkedList<>();
groupDeviceList.add(device);
groupXHashMap.put(groupID, groupDeviceList);
} else {
@@ -419,6 +420,6 @@ public Circuit deleteCircuit(String dSUID) {
@Override
public Map getCircuitMap() {
- return new HashMap(circuitMap);
+ return new HashMap<>(circuitMap);
}
}
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/TemperatureControlManager.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/TemperatureControlManager.java
index 767b10173e106..023f98043f0c2 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/TemperatureControlManager.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/TemperatureControlManager.java
@@ -114,7 +114,7 @@ public class TemperatureControlManager implements EventHandler, TemperatureContr
private String currentHeatingWaterSystemStage;
- private final List echoBox = Collections.synchronizedList(new LinkedList());
+ private final List echoBox = Collections.synchronizedList(new LinkedList<>());
/**
* Creates a new {@link TemperatureControlManager}. The {@link ConnectionManager} is needed. The other fields are
@@ -196,8 +196,7 @@ public static boolean isHeatingControllerInstallated(ConnectionManager connectio
* @return all temperature controlled zones
*/
public Collection getTemperatureControlStatusFromAllZones() {
- return temperationControlStatus != null ? this.temperationControlStatus.values()
- : new LinkedList();
+ return temperationControlStatus != null ? this.temperationControlStatus.values() : new LinkedList<>();
}
/**
@@ -222,7 +221,7 @@ public void registerTemperatureControlStatusListener(
}
} else {
if (zoneTemperationControlListenerMap == null) {
- zoneTemperationControlListenerMap = new HashMap();
+ zoneTemperationControlListenerMap = new HashMap<>();
}
TemperatureControlStatus tempConStat = checkAndGetTemperatureControlStatus(
temperatureControlStatusListener.getTemperationControlStatusListenrID());
@@ -339,7 +338,7 @@ public void handleEvent(EventItem eventItem) {
private void addTemperatureControlStatus(TemperatureControlStatus temperationControlStatus) {
if (temperationControlStatus.isNotSetOff()) {
if (this.temperationControlStatus == null) {
- this.temperationControlStatus = new HashMap();
+ this.temperationControlStatus = new HashMap<>();
}
if (this.temperationControlStatus.get(temperationControlStatus.getZoneID()) == null && discovery != null) {
discovery.configChanged(temperationControlStatus);
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/AbstractSensorJobExecutor.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/AbstractSensorJobExecutor.java
index d4a86717c4637..33fee86c8775a 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/AbstractSensorJobExecutor.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/AbstractSensorJobExecutor.java
@@ -57,7 +57,7 @@ public abstract class AbstractSensorJobExecutor {
protected Config config;
private final ConnectionManager connectionManager;
- private final List circuitSchedulerList = new LinkedList();
+ private final List circuitSchedulerList = new LinkedList<>();
private class ExecutorRunnable implements Runnable {
private final CircuitScheduler circuit;
@@ -109,7 +109,7 @@ public synchronized void shutdown() {
public synchronized void startExecutor() {
logger.debug("start all circuit schedulers.");
if (pollingSchedulers == null) {
- pollingSchedulers = new HashMap>();
+ pollingSchedulers = new HashMap<>();
}
if (circuitSchedulerList != null && !circuitSchedulerList.isEmpty()) {
for (CircuitScheduler circuit : circuitSchedulerList) {
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/CircuitScheduler.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/CircuitScheduler.java
index f7fec839446c3..5e2467125a25f 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/CircuitScheduler.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/CircuitScheduler.java
@@ -43,7 +43,7 @@ public int compare(SensorJob job1, SensorJob job2) {
private final DSID meterDSID;
private long nextExecutionTime = System.currentTimeMillis();
- private final PriorityQueue sensorJobQueue = new PriorityQueue(10, new SensorJobComparator());
+ private final PriorityQueue sensorJobQueue = new PriorityQueue<>(10, new SensorJobComparator());
private final Config config;
/**
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/DsAPI.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/DsAPI.java
index 1aa03836a49d4..56bfcadf6fd64 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/DsAPI.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/DsAPI.java
@@ -12,10 +12,11 @@
*/
package org.openhab.binding.digitalstrom.internal.lib.serverconnection;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.openhab.binding.digitalstrom.internal.lib.climate.constants.ControlModes;
+import org.openhab.binding.digitalstrom.internal.lib.climate.constants.OperationModes;
import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.BaseSensorValues;
import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.AssignedSensors;
import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.SensorValues;
@@ -829,7 +830,7 @@ TemperatureControlInternals getZoneTemperatureControlInternals(String sessionTok
* registered at the {@link HttpTransport}
* @return temperature control status of all zones
*/
- HashMap getApartmentTemperatureControlConfig(String sessionToken);
+ Map getApartmentTemperatureControlConfig(String sessionToken);
/**
* Returns the temperature control status of all zones.
@@ -839,7 +840,7 @@ TemperatureControlInternals getZoneTemperatureControlInternals(String sessionTok
* registered at the {@link HttpTransport}
* @return temperature control status of all zones
*/
- HashMap getApartmentTemperatureControlValues(String sessionToken);
+ Map getApartmentTemperatureControlValues(String sessionToken);
/**
* Returns the assigned Sensor dSUID of all zones.
@@ -850,7 +851,7 @@ TemperatureControlInternals getZoneTemperatureControlInternals(String sessionTok
* registered at the {@link HttpTransport}
* @return assigned Sensor dSUID of all zones.
*/
- HashMap getApartmentAssignedSensors(String sessionToken);
+ Map getApartmentAssignedSensors(String sessionToken);
/**
* Returns the value of a Sensor of all zones.
@@ -860,7 +861,7 @@ TemperatureControlInternals getZoneTemperatureControlInternals(String sessionTok
* registered at the {@link HttpTransport}
* @return value of a Sensor of all zones
*/
- HashMap getApartmentSensorValues(String sessionToken);
+ Map getApartmentSensorValues(String sessionToken);
/**
* Description taken form digitalSTROM JSON-API:
diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/impl/DsAPIImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/impl/DsAPIImpl.java
index 4b1f85a7ccb6e..ba9d423f45ead 100644
--- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/impl/DsAPIImpl.java
+++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/impl/DsAPIImpl.java
@@ -191,7 +191,7 @@ public List getApartmentDevices(String token) {
&& responseObj.get(JSONApiResponseKeysEnum.RESULT.getKey()) instanceof JsonArray) {
JsonArray array = (JsonArray) responseObj.get(JSONApiResponseKeysEnum.RESULT.getKey());
- List deviceList = new LinkedList();
+ List deviceList = new LinkedList<>();
for (int i = 0; i < array.size(); i++) {
if (array.get(i) instanceof JsonObject) {
deviceList.add(new DeviceImpl((JsonObject) array.get(i)));
@@ -199,7 +199,7 @@ public List getApartmentDevices(String token) {
}
return deviceList;
}
- return new LinkedList();
+ return new LinkedList<>();
}
@Override
@@ -214,7 +214,7 @@ public List getApartmentCircuits(String sessionToken) {
if (responseObj.get(JSONApiResponseKeysEnum.CIRCUITS.getKey()).isJsonArray()) {
JsonArray array = responseObj.get(JSONApiResponseKeysEnum.CIRCUITS.getKey()).getAsJsonArray();
- List circuitList = new LinkedList();
+ List circuitList = new LinkedList<>();
for (int i = 0; i < array.size(); i++) {
if (array.get(i).isJsonObject()) {
circuitList.add(new CircuitImpl(array.get(i).getAsJsonObject()));
@@ -223,7 +223,7 @@ public List getApartmentCircuits(String sessionToken) {
return circuitList;
}
}
- return new LinkedList();
+ return new LinkedList<>();
}
@Override
@@ -483,7 +483,7 @@ public List getResolutions(String token) {
if (resObj != null && resObj.get(JSONApiResponseKeysEnum.RESOLUTIONS.getKey()) instanceof JsonArray) {
JsonArray array = (JsonArray) resObj.get(JSONApiResponseKeysEnum.RESOLUTIONS.getKey());
- List resolutionList = new LinkedList();
+ List resolutionList = new LinkedList<>();
for (int i = 0; i < array.size(); i++) {
if (array.get(i) instanceof JsonObject) {
JsonObject jObject = (JsonObject) array.get(i);
@@ -543,7 +543,7 @@ public List getLatest(String token, MeteringTypeEnum type,
if (latestObj != null && latestObj.get(JSONApiResponseKeysEnum.VALUES.getKey()) instanceof JsonArray) {
JsonArray array = (JsonArray) latestObj.get(JSONApiResponseKeysEnum.VALUES.getKey());
- List list = new LinkedList();
+ List