Remove unused local variables (#10528)
Fixes 26 SAT UnusedLocalVariable findings Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
parent
030329c118
commit
b42101addc
|
@ -64,11 +64,7 @@ public class MadokaMessageTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testParseOperationHours() {
|
public void testParseOperationHours() {
|
||||||
String s = "390001120201004004DC0B00004104F40300004204642300004304000000004404000000004504000000004604000000004704000000004800";
|
|
||||||
|
|
||||||
MadokaValue mv = new MadokaValue(0, 4, new byte[] { (byte) 0xF4, 0x03, 0x00, 0x00 });
|
MadokaValue mv = new MadokaValue(0, 4, new byte[] { (byte) 0xF4, 0x03, 0x00, 0x00 });
|
||||||
// MadokaValue mv = new MadokaValue(0, 4, new byte[] { 0x00, 0x00, 0x03, (byte) 0xF4 });
|
|
||||||
|
|
||||||
Long v = mv.getComputedValue(ByteOrder.LITTLE_ENDIAN);
|
Long v = mv.getComputedValue(ByteOrder.LITTLE_ENDIAN);
|
||||||
assertEquals(1012, v);
|
assertEquals(1012, v);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,6 @@ import org.openhab.core.thing.ChannelUID;
|
||||||
import org.openhab.core.thing.Thing;
|
import org.openhab.core.thing.Thing;
|
||||||
import org.openhab.core.thing.ThingStatus;
|
import org.openhab.core.thing.ThingStatus;
|
||||||
import org.openhab.core.thing.ThingStatusDetail;
|
import org.openhab.core.thing.ThingStatusDetail;
|
||||||
import org.openhab.core.thing.ThingTypeUID;
|
|
||||||
import org.openhab.core.thing.binding.BaseThingHandler;
|
import org.openhab.core.thing.binding.BaseThingHandler;
|
||||||
import org.openhab.core.types.Command;
|
import org.openhab.core.types.Command;
|
||||||
import org.openhab.core.types.State;
|
import org.openhab.core.types.State;
|
||||||
|
@ -227,7 +226,6 @@ public abstract class DaikinBaseHandler extends BaseThingHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changeHomekitMode(String homekitmode) throws DaikinCommunicationException {
|
private void changeHomekitMode(String homekitmode) throws DaikinCommunicationException {
|
||||||
ThingTypeUID thingTypeUID = thing.getThingTypeUID();
|
|
||||||
if (HomekitMode.OFF.getValue().equals(homekitmode)) {
|
if (HomekitMode.OFF.getValue().equals(homekitmode)) {
|
||||||
changePower(false);
|
changePower(false);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -270,12 +270,10 @@ public class FSInternetRadioDiscoveryParticipant implements UpnpDiscoveryPartici
|
||||||
// Some devices report crappy UPnP device description so manufacturer and model are ""
|
// Some devices report crappy UPnP device description so manufacturer and model are ""
|
||||||
// In this case we try to find the match in friendlyName
|
// In this case we try to find the match in friendlyName
|
||||||
final String uname = friendlyName.toUpperCase();
|
final String uname = friendlyName.toUpperCase();
|
||||||
for (Map.Entry<String, Set<String>> entry : SUPPORTED_RADIO_MODELS.entrySet()) {
|
for (Set<String> set : SUPPORTED_RADIO_MODELS.values()) {
|
||||||
for (Set<String> set : SUPPORTED_RADIO_MODELS.values()) {
|
for (String model : set) {
|
||||||
for (String model : set) {
|
if ((model != null) && !model.isEmpty() && uname.contains(model)) {
|
||||||
if ((model != null) && !model.isEmpty() && uname.contains(model)) {
|
return new ThingUID(THING_TYPE_RADIO, serialNumber);
|
||||||
return new ThingUID(THING_TYPE_RADIO, serialNumber);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,7 +151,7 @@ public class Mhub4K431Handler extends BaseThingHandler {
|
||||||
httpHeaders.setProperty("Cookie", "logintype-88=01");
|
httpHeaders.setProperty("Cookie", "logintype-88=01");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String response = HttpUtil.executeUrl(httpMethod, url, httpHeaders, stream,
|
HttpUtil.executeUrl(httpMethod, url, httpHeaders, stream,
|
||||||
"application/x-www-form-urlencoded; charset=UTF-8", timeout);
|
"application/x-www-form-urlencoded; charset=UTF-8", timeout);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.debug("Communication with device failed", e);
|
logger.debug("Communication with device failed", e);
|
||||||
|
|
|
@ -49,7 +49,6 @@ import org.oasis_open.docs.wsn.b_2.Subscribe;
|
||||||
import org.oasis_open.docs.wsn.b_2.SubscribeResponse;
|
import org.oasis_open.docs.wsn.b_2.SubscribeResponse;
|
||||||
import org.oasis_open.docs.wsn.b_2.TopicExpressionType;
|
import org.oasis_open.docs.wsn.b_2.TopicExpressionType;
|
||||||
import org.oasis_open.docs.wsn.b_2.Unsubscribe;
|
import org.oasis_open.docs.wsn.b_2.Unsubscribe;
|
||||||
import org.oasis_open.docs.wsn.b_2.UnsubscribeResponse;
|
|
||||||
import org.oasis_open.docs.wsn.bw_2.InvalidFilterFault;
|
import org.oasis_open.docs.wsn.bw_2.InvalidFilterFault;
|
||||||
import org.oasis_open.docs.wsn.bw_2.InvalidMessageContentExpressionFault;
|
import org.oasis_open.docs.wsn.bw_2.InvalidMessageContentExpressionFault;
|
||||||
import org.oasis_open.docs.wsn.bw_2.InvalidProducerPropertiesExpressionFault;
|
import org.oasis_open.docs.wsn.bw_2.InvalidProducerPropertiesExpressionFault;
|
||||||
|
@ -347,7 +346,7 @@ public class HeliosHandler27 extends BaseThingHandler implements NotificationCon
|
||||||
public void unsubscribe() {
|
public void unsubscribe() {
|
||||||
if (subscription != null) {
|
if (subscription != null) {
|
||||||
try {
|
try {
|
||||||
UnsubscribeResponse response = subscription.unsubscribe(new Unsubscribe());
|
subscription.unsubscribe(new Unsubscribe());
|
||||||
logger.debug("Unsubscribing the subscription with ID '{}' for '{}' ", getSubscriptionID(),
|
logger.debug("Unsubscribing the subscription with ID '{}' for '{}' ", getSubscriptionID(),
|
||||||
getThing().getUID());
|
getThing().getUID());
|
||||||
} catch (UnableToDestroySubscriptionFault | ResourceUnknownFault e) {
|
} catch (UnableToDestroySubscriptionFault | ResourceUnknownFault e) {
|
||||||
|
|
|
@ -25,7 +25,6 @@ import org.eclipse.jdt.annotation.Nullable;
|
||||||
import org.openhab.binding.innogysmarthome.internal.InnogyBindingConstants;
|
import org.openhab.binding.innogysmarthome.internal.InnogyBindingConstants;
|
||||||
import org.openhab.binding.innogysmarthome.internal.client.InnogyClient;
|
import org.openhab.binding.innogysmarthome.internal.client.InnogyClient;
|
||||||
import org.openhab.binding.innogysmarthome.internal.client.entity.capability.Capability;
|
import org.openhab.binding.innogysmarthome.internal.client.entity.capability.Capability;
|
||||||
import org.openhab.binding.innogysmarthome.internal.client.entity.capability.State;
|
|
||||||
import org.openhab.binding.innogysmarthome.internal.client.entity.device.Device;
|
import org.openhab.binding.innogysmarthome.internal.client.entity.device.Device;
|
||||||
import org.openhab.binding.innogysmarthome.internal.client.entity.link.Link;
|
import org.openhab.binding.innogysmarthome.internal.client.entity.link.Link;
|
||||||
import org.openhab.binding.innogysmarthome.internal.client.entity.message.Message;
|
import org.openhab.binding.innogysmarthome.internal.client.entity.message.Message;
|
||||||
|
@ -131,9 +130,7 @@ public class DeviceStructureManager {
|
||||||
if (d.isRadioDevice() && !d.isReachable()) {
|
if (d.isRadioDevice() && !d.isReachable()) {
|
||||||
logger.debug(">> CAP-State: unknown (device NOT REACHABLE).");
|
logger.debug(">> CAP-State: unknown (device NOT REACHABLE).");
|
||||||
} else {
|
} else {
|
||||||
if (c.hasState()) {
|
if (!c.hasState()) {
|
||||||
final State state = c.getCapabilityState().getState();
|
|
||||||
} else {
|
|
||||||
logger.debug(">> CAP-State: unknown (NULL)");
|
logger.debug(">> CAP-State: unknown (NULL)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -849,7 +849,6 @@ public class EthernetBridgeHandler extends BaseBridgeHandler implements Transcei
|
||||||
|
|
||||||
Matcher matcher = RESPONSE_PATTERN.matcher(response);
|
Matcher matcher = RESPONSE_PATTERN.matcher(response);
|
||||||
if (matcher.matches()) {
|
if (matcher.matches()) {
|
||||||
String byteCountAsString = matcher.group(1);
|
|
||||||
message = matcher.group(2);
|
message = matcher.group(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -254,7 +254,7 @@ public class KeContactTransceiver {
|
||||||
new Object[] { new String(theBuffer.array()),
|
new Object[] { new String(theBuffer.array()),
|
||||||
theChannel.getLocalAddress(),
|
theChannel.getLocalAddress(),
|
||||||
theChannel.getRemoteAddress() });
|
theChannel.getRemoteAddress() });
|
||||||
int byteswritten = theChannel.write(theBuffer);
|
theChannel.write(theBuffer);
|
||||||
} catch (NotYetConnectedException e) {
|
} catch (NotYetConnectedException e) {
|
||||||
theHandler.updateStatus(ThingStatus.OFFLINE,
|
theHandler.updateStatus(ThingStatus.OFFLINE,
|
||||||
ThingStatusDetail.COMMUNICATION_ERROR,
|
ThingStatusDetail.COMMUNICATION_ERROR,
|
||||||
|
|
|
@ -23,7 +23,6 @@ import java.util.stream.Stream;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openhab.binding.miele.internal.handler.MieleBridgeHandler.DeviceClassObject;
|
import org.openhab.binding.miele.internal.handler.MieleBridgeHandler.DeviceClassObject;
|
||||||
import org.openhab.binding.miele.internal.handler.MieleBridgeHandler.DeviceMetaData;
|
import org.openhab.binding.miele.internal.handler.MieleBridgeHandler.DeviceMetaData;
|
||||||
import org.openhab.binding.miele.internal.handler.MieleBridgeHandler.DeviceOperation;
|
|
||||||
import org.openhab.binding.miele.internal.handler.MieleBridgeHandler.DeviceProperty;
|
import org.openhab.binding.miele.internal.handler.MieleBridgeHandler.DeviceProperty;
|
||||||
import org.openhab.binding.miele.internal.handler.MieleBridgeHandler.HomeDevice;
|
import org.openhab.binding.miele.internal.handler.MieleBridgeHandler.HomeDevice;
|
||||||
import org.openhab.core.thing.Bridge;
|
import org.openhab.core.thing.Bridge;
|
||||||
|
@ -162,15 +161,6 @@ public abstract class MieleApplianceHandler<E extends Enum<E> & ApplianceChannel
|
||||||
// Ignore - this is due to an unrecognized and not yet reverse-engineered array property
|
// Ignore - this is due to an unrecognized and not yet reverse-engineered array property
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (JsonElement operation : dco.Operations.getAsJsonArray()) {
|
|
||||||
try {
|
|
||||||
DeviceOperation devop = gson.fromJson(operation, DeviceOperation.class);
|
|
||||||
DeviceMetaData pmd = gson.fromJson(devop.Metadata, DeviceMetaData.class);
|
|
||||||
} catch (Exception p) {
|
|
||||||
// Ignore - this is due to an unrecognized and not yet reverse-engineered array property
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,6 @@ public class AtomicStampedKeyValueTest {
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testCopyIfStampAfterEqual() {
|
public void testCopyIfStampAfterEqual() {
|
||||||
Object key = new Object();
|
|
||||||
Object val = new Object();
|
Object val = new Object();
|
||||||
AtomicStampedValue<Object> keyValue = new AtomicStampedValue<>(42L, val);
|
AtomicStampedValue<Object> keyValue = new AtomicStampedValue<>(42L, val);
|
||||||
AtomicStampedValue<Object> copy = keyValue.copyIfStampAfter(42L);
|
AtomicStampedValue<Object> copy = keyValue.copyIfStampAfter(42L);
|
||||||
|
@ -98,7 +97,6 @@ public class AtomicStampedKeyValueTest {
|
||||||
assertThat(keyValue.getValue(), is(equalTo(copy.getValue())));
|
assertThat(keyValue.getValue(), is(equalTo(copy.getValue())));
|
||||||
|
|
||||||
// after update they live life of their own
|
// after update they live life of their own
|
||||||
Object key2 = new Object();
|
|
||||||
Object val2 = new Object();
|
Object val2 = new Object();
|
||||||
copy.update(-99L, val2);
|
copy.update(-99L, val2);
|
||||||
|
|
||||||
|
@ -144,7 +142,6 @@ public class AtomicStampedKeyValueTest {
|
||||||
assertThat(keyValue.getValue(), is(equalTo(copy.getValue())));
|
assertThat(keyValue.getValue(), is(equalTo(copy.getValue())));
|
||||||
|
|
||||||
// after update they live life of their own
|
// after update they live life of their own
|
||||||
Object key2 = new Object();
|
|
||||||
Object val2 = new Object();
|
Object val2 = new Object();
|
||||||
copy.update(-99L, val2);
|
copy.update(-99L, val2);
|
||||||
|
|
||||||
|
|
|
@ -230,28 +230,27 @@ public abstract class AbstractBrokerHandler extends BaseBridgeHandler implements
|
||||||
* @param topic the topic (as specified during registration)
|
* @param topic the topic (as specified during registration)
|
||||||
*/
|
*/
|
||||||
public final void unregisterDiscoveryListener(MQTTTopicDiscoveryParticipant listener, String topic) {
|
public final void unregisterDiscoveryListener(MQTTTopicDiscoveryParticipant listener, String topic) {
|
||||||
Map<MQTTTopicDiscoveryParticipant, @Nullable TopicSubscribe> topicListeners = discoveryTopics.compute(topic,
|
discoveryTopics.compute(topic, (k, v) -> {
|
||||||
(k, v) -> {
|
if (v == null) {
|
||||||
if (v == null) {
|
logger.warn(
|
||||||
logger.warn(
|
"Tried to unsubscribe {} from discovery topic {} on broker {} but topic not registered at all. Check discovery logic!",
|
||||||
"Tried to unsubscribe {} from discovery topic {} on broker {} but topic not registered at all. Check discovery logic!",
|
listener, topic, thing.getUID());
|
||||||
listener, topic, thing.getUID());
|
return null;
|
||||||
return null;
|
}
|
||||||
}
|
v.compute(listener, (l, w) -> {
|
||||||
v.compute(listener, (l, w) -> {
|
if (w == null) {
|
||||||
if (w == null) {
|
logger.warn(
|
||||||
logger.warn(
|
"Tried to unsubscribe {} from discovery topic {} on broker {} but topic not registered for listener. Check discovery logic!",
|
||||||
"Tried to unsubscribe {} from discovery topic {} on broker {} but topic not registered for listener. Check discovery logic!",
|
listener, topic, thing.getUID());
|
||||||
listener, topic, thing.getUID());
|
} else {
|
||||||
} else {
|
w.stop();
|
||||||
w.stop();
|
logger.trace("Unsubscribed {} from discovery topic {} on broker {}", listener, topic,
|
||||||
logger.trace("Unsubscribed {} from discovery topic {} on broker {}", listener, topic,
|
thing.getUID());
|
||||||
thing.getUID());
|
}
|
||||||
}
|
return null;
|
||||||
return null;
|
});
|
||||||
});
|
return v.isEmpty() ? null : v;
|
||||||
return v.isEmpty() ? null : v;
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -263,7 +263,6 @@ public class ShellyComponents {
|
||||||
updated |= thingHandler.updateChannel(CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_CONTACT,
|
updated |= thingHandler.updateChannel(CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_CONTACT,
|
||||||
getString(sdata.sensor.state).equalsIgnoreCase(SHELLY_API_DWSTATE_OPEN) ? OpenClosedType.OPEN
|
getString(sdata.sensor.state).equalsIgnoreCase(SHELLY_API_DWSTATE_OPEN) ? OpenClosedType.OPEN
|
||||||
: OpenClosedType.CLOSED);
|
: OpenClosedType.CLOSED);
|
||||||
String sensorError = getString(sdata.sensorError);
|
|
||||||
boolean changed = thingHandler.updateChannel(CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_ERROR,
|
boolean changed = thingHandler.updateChannel(CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_ERROR,
|
||||||
getStringType(sdata.sensorError));
|
getStringType(sdata.sensorError));
|
||||||
if (changed) {
|
if (changed) {
|
||||||
|
|
|
@ -227,7 +227,7 @@ public class ShellyManagerActionPage extends ShellyManagerPage {
|
||||||
actionUrl = buildActionUrl(uid, action);
|
actionUrl = buildActionUrl(uid, action);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
String result = api.resetStaCache();
|
api.resetStaCache();
|
||||||
message = getMessage("action.resetsta-confirm");
|
message = getMessage("action.resetsta-confirm");
|
||||||
} catch (ShellyApiException e) {
|
} catch (ShellyApiException e) {
|
||||||
message = getMessageP("action.resetsta-failed", e.toString());
|
message = getMessageP("action.resetsta-failed", e.toString());
|
||||||
|
@ -243,7 +243,7 @@ public class ShellyManagerActionPage extends ShellyManagerPage {
|
||||||
actionUrl = buildActionUrl(uid, action);
|
actionUrl = buildActionUrl(uid, action);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
String result = api.setWiFiRecovery(enable);
|
api.setWiFiRecovery(enable);
|
||||||
message = getMessage("action.setwifirec-confirm", enable ? "enabled" : "disabled");
|
message = getMessage("action.setwifirec-confirm", enable ? "enabled" : "disabled");
|
||||||
} catch (ShellyApiException e) {
|
} catch (ShellyApiException e) {
|
||||||
message = getMessage("action.setwifirec-failed", e.toString());
|
message = getMessage("action.setwifirec-failed", e.toString());
|
||||||
|
@ -260,7 +260,7 @@ public class ShellyManagerActionPage extends ShellyManagerPage {
|
||||||
actionUrl = buildActionUrl(uid, action);
|
actionUrl = buildActionUrl(uid, action);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
String result = api.setApRoaming(enable);
|
api.setApRoaming(enable);
|
||||||
message = getMessage("action.aproaming-confirm", enable ? "enabled" : "disabled");
|
message = getMessage("action.aproaming-confirm", enable ? "enabled" : "disabled");
|
||||||
} catch (ShellyApiException e) {
|
} catch (ShellyApiException e) {
|
||||||
message = getMessage("action.aproaming-failed", e.toString());
|
message = getMessage("action.aproaming-failed", e.toString());
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class ShellyManagerCache<K, V> extends ConcurrentHashMap<K, V> {
|
||||||
long currentTime = new Date().getTime();
|
long currentTime = new Date().getTime();
|
||||||
for (K key : timeMap.keySet()) {
|
for (K key : timeMap.keySet()) {
|
||||||
if (currentTime > (timeMap.get(key) + expiryInMillis)) {
|
if (currentTime > (timeMap.get(key) + expiryInMillis)) {
|
||||||
V value = remove(key);
|
remove(key);
|
||||||
timeMap.remove(key);
|
timeMap.remove(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -430,6 +430,7 @@ public class ValloxMVWebSocket {
|
||||||
BigDecimal bdTempIncoming = getTemperature(bytes, 138);
|
BigDecimal bdTempIncoming = getTemperature(bytes, 138);
|
||||||
|
|
||||||
int iHumidity = getNumberBE(bytes, 148);
|
int iHumidity = getNumberBE(bytes, 148);
|
||||||
|
@SuppressWarnings("unused")
|
||||||
int iCo2 = getNumberBE(bytes, 150);
|
int iCo2 = getNumberBE(bytes, 150);
|
||||||
|
|
||||||
int iStateOrig = getNumberBE(bytes, 214);
|
int iStateOrig = getNumberBE(bytes, 214);
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class DummyItemRegistry implements ItemRegistry {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item add(Item element) {
|
public Item add(Item element) {
|
||||||
Item put = items.put(element.getUID(), element);
|
items.put(element.getUID(), element);
|
||||||
for (RegistryChangeListener<Item> l : listeners) {
|
for (RegistryChangeListener<Item> l : listeners) {
|
||||||
l.added(element);
|
l.added(element);
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class DummyMetadataRegistry implements MetadataRegistry {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Metadata add(Metadata element) {
|
public Metadata add(Metadata element) {
|
||||||
Metadata put = items.put(element.getUID(), element);
|
items.put(element.getUID(), element);
|
||||||
for (RegistryChangeListener<Metadata> l : listeners) {
|
for (RegistryChangeListener<Metadata> l : listeners) {
|
||||||
l.added(element);
|
l.added(element);
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class DummyRuleRegistry implements RuleRegistry {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Rule add(Rule element) {
|
public Rule add(Rule element) {
|
||||||
Rule put = items.put(element.getUID(), element);
|
items.put(element.getUID(), element);
|
||||||
for (RegistryChangeListener<Rule> l : listeners) {
|
for (RegistryChangeListener<Rule> l : listeners) {
|
||||||
l.added(element);
|
l.added(element);
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,6 @@ import org.openhab.core.thing.ThingStatus;
|
||||||
import org.openhab.core.thing.ThingStatusDetail;
|
import org.openhab.core.thing.ThingStatusDetail;
|
||||||
import org.openhab.core.thing.ThingStatusInfo;
|
import org.openhab.core.thing.ThingStatusInfo;
|
||||||
import org.openhab.core.thing.ThingUID;
|
import org.openhab.core.thing.ThingUID;
|
||||||
import org.openhab.core.thing.binding.ThingHandler;
|
|
||||||
import org.openhab.core.thing.binding.builder.BridgeBuilder;
|
import org.openhab.core.thing.binding.builder.BridgeBuilder;
|
||||||
import org.openhab.core.thing.binding.builder.ChannelBuilder;
|
import org.openhab.core.thing.binding.builder.ChannelBuilder;
|
||||||
import org.openhab.core.thing.binding.builder.ThingBuilder;
|
import org.openhab.core.thing.binding.builder.ThingBuilder;
|
||||||
|
@ -154,7 +153,6 @@ public class ModbusDataHandlerTest extends AbstractModbusOSGiTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Bridge createTcpMock() {
|
private Bridge createTcpMock() {
|
||||||
ModbusSlaveEndpoint endpoint = new ModbusTCPSlaveEndpoint("thisishost", 502, false);
|
|
||||||
Bridge tcpBridge = ModbusPollerThingHandlerTest.createTcpThingBuilder("tcp1").build();
|
Bridge tcpBridge = ModbusPollerThingHandlerTest.createTcpThingBuilder("tcp1").build();
|
||||||
ModbusTcpThingHandler tcpThingHandler = Mockito.mock(ModbusTcpThingHandler.class);
|
ModbusTcpThingHandler tcpThingHandler = Mockito.mock(ModbusTcpThingHandler.class);
|
||||||
tcpBridge.setStatusInfo(new ThingStatusInfo(ThingStatus.ONLINE, ThingStatusDetail.NONE, ""));
|
tcpBridge.setStatusInfo(new ThingStatusInfo(ThingStatus.ONLINE, ThingStatusDetail.NONE, ""));
|
||||||
|
@ -824,7 +822,6 @@ public class ModbusDataHandlerTest extends AbstractModbusOSGiTest {
|
||||||
assertThat(dataHandler.getThing().getStatus(), is(equalTo(ThingStatus.ONLINE)));
|
assertThat(dataHandler.getThing().getStatus(), is(equalTo(ThingStatus.ONLINE)));
|
||||||
|
|
||||||
verify(comms, never()).submitOneTimePoll(eq(request), notNull(), notNull());
|
verify(comms, never()).submitOneTimePoll(eq(request), notNull(), notNull());
|
||||||
ModbusPollerThingHandler handler = (ModbusPollerThingHandler) poller.getHandler();
|
|
||||||
// Wait for all channels to receive the REFRESH command (initiated by the core)
|
// Wait for all channels to receive the REFRESH command (initiated by the core)
|
||||||
waitForAssert(
|
waitForAssert(
|
||||||
() -> verify((ModbusPollerThingHandler) poller.getHandler(), times(CHANNEL_TO_ACCEPTED_TYPE.size()))
|
() -> verify((ModbusPollerThingHandler) poller.getHandler(), times(CHANNEL_TO_ACCEPTED_TYPE.size()))
|
||||||
|
@ -854,7 +851,6 @@ public class ModbusDataHandlerTest extends AbstractModbusOSGiTest {
|
||||||
Bridge parent;
|
Bridge parent;
|
||||||
if (pollerFunctionCode == null) {
|
if (pollerFunctionCode == null) {
|
||||||
parent = createTcpMock();
|
parent = createTcpMock();
|
||||||
ThingHandler foo = parent.getHandler();
|
|
||||||
addThing(parent);
|
addThing(parent);
|
||||||
} else {
|
} else {
|
||||||
ModbusSlaveEndpoint endpoint = new ModbusTCPSlaveEndpoint("thisishost", 502, false);
|
ModbusSlaveEndpoint endpoint = new ModbusTCPSlaveEndpoint("thisishost", 502, false);
|
||||||
|
|
|
@ -16,7 +16,6 @@ import static org.hamcrest.CoreMatchers.*;
|
||||||
import static org.hamcrest.MatcherAssert.assertThat;
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
|
|
||||||
import org.openhab.binding.wemo.internal.WemoBindingConstants;
|
import org.openhab.binding.wemo.internal.WemoBindingConstants;
|
||||||
import org.openhab.binding.wemo.internal.handler.AbstractWemoHandler;
|
|
||||||
import org.openhab.core.config.core.Configuration;
|
import org.openhab.core.config.core.Configuration;
|
||||||
import org.openhab.core.thing.Bridge;
|
import org.openhab.core.thing.Bridge;
|
||||||
import org.openhab.core.thing.Channel;
|
import org.openhab.core.thing.Channel;
|
||||||
|
@ -25,7 +24,6 @@ import org.openhab.core.thing.Thing;
|
||||||
import org.openhab.core.thing.ThingStatus;
|
import org.openhab.core.thing.ThingStatus;
|
||||||
import org.openhab.core.thing.ThingTypeUID;
|
import org.openhab.core.thing.ThingTypeUID;
|
||||||
import org.openhab.core.thing.ThingUID;
|
import org.openhab.core.thing.ThingUID;
|
||||||
import org.openhab.core.thing.binding.ThingHandler;
|
|
||||||
import org.openhab.core.thing.binding.builder.BridgeBuilder;
|
import org.openhab.core.thing.binding.builder.BridgeBuilder;
|
||||||
import org.openhab.core.thing.binding.builder.ChannelBuilder;
|
import org.openhab.core.thing.binding.builder.ChannelBuilder;
|
||||||
import org.openhab.core.thing.binding.builder.ThingBuilder;
|
import org.openhab.core.thing.binding.builder.ThingBuilder;
|
||||||
|
@ -85,12 +83,6 @@ public class GenericWemoLightOSGiTestParent extends GenericWemoOSGiTest {
|
||||||
.withBridge(bridgeUID).build();
|
.withBridge(bridgeUID).build();
|
||||||
|
|
||||||
managedThingProvider.add(thing);
|
managedThingProvider.add(thing);
|
||||||
|
|
||||||
ThingHandler handler = thing.getHandler();
|
|
||||||
if (handler != null) {
|
|
||||||
AbstractWemoHandler h = (AbstractWemoHandler) handler;
|
|
||||||
}
|
|
||||||
|
|
||||||
return thing;
|
return thing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue