Reduce SAT warnings (#15090)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
parent
7ef268f4d2
commit
a5c47aebee
@ -85,7 +85,6 @@ public abstract class ADThingHandler extends BaseThingHandler {
|
|||||||
if (bridgeStatus == ThingStatus.ONLINE
|
if (bridgeStatus == ThingStatus.ONLINE
|
||||||
&& getThing().getStatusInfo().getStatusDetail() == ThingStatusDetail.BRIDGE_OFFLINE) {
|
&& getThing().getStatusInfo().getStatusDetail() == ThingStatusDetail.BRIDGE_OFFLINE) {
|
||||||
initDeviceState();
|
initDeviceState();
|
||||||
|
|
||||||
} else if (bridgeStatus == ThingStatus.OFFLINE) {
|
} else if (bridgeStatus == ThingStatus.OFFLINE) {
|
||||||
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE);
|
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,7 +82,6 @@ public class KeypadMessage extends ADMessage {
|
|||||||
this.nbeeps = Integer.parseInt(parts.get(0).substring(6, 7));
|
this.nbeeps = Integer.parseInt(parts.get(0).substring(6, 7));
|
||||||
this.lower = Integer.parseInt(parts.get(0).substring(7, 17), 2);
|
this.lower = Integer.parseInt(parts.get(0).substring(7, 17), 2);
|
||||||
this.status = ((upper & 0x1F) << 13) | ((nbeeps & 0x3) << 10) | lower;
|
this.status = ((upper & 0x1F) << 13) | ((nbeeps & 0x3) << 10) | lower;
|
||||||
|
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
throw new IllegalArgumentException("keypad msg contains invalid number: " + e.getMessage(), e);
|
throw new IllegalArgumentException("keypad msg contains invalid number: " + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -488,7 +488,6 @@ public class WebSocketConnection {
|
|||||||
sum += toUnsignedInt((data[index] & 0xFF) << ((index & 3 ^ 3) << 3));
|
sum += toUnsignedInt((data[index] & 0xFF) << ((index & 3 ^ 3) << 3));
|
||||||
overflow += computeBits(sum, 32);
|
overflow += computeBits(sum, 32);
|
||||||
sum = toUnsignedInt((int) sum & (int) 4294967295L);
|
sum = toUnsignedInt((int) sum & (int) 4294967295L);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
index = exclusionEnd - 1;
|
index = exclusionEnd - 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,10 +80,7 @@ public class RadoneyeDiscoveryParticipant implements BluetoothDiscoveryParticipa
|
|||||||
|
|
||||||
private boolean isRadoneyeDevice(BluetoothDiscoveryDevice device) {
|
private boolean isRadoneyeDevice(BluetoothDiscoveryDevice device) {
|
||||||
String manufacturerMacId = device.getAddress().toString().toLowerCase().replace(":", "").substring(0, 6);
|
String manufacturerMacId = device.getAddress().toString().toLowerCase().replace(":", "").substring(0, 6);
|
||||||
if (manufacturerMacId.equals(RADONEYE_BLUETOOTH_COMPANY_ID.toLowerCase())) {
|
return manufacturerMacId.equals(RADONEYE_BLUETOOTH_COMPANY_ID.toLowerCase());
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getSerial(BluetoothDiscoveryDevice device) {
|
private String getSerial(BluetoothDiscoveryDevice device) {
|
||||||
@ -120,7 +117,6 @@ public class RadoneyeDiscoveryParticipant implements BluetoothDiscoveryParticipa
|
|||||||
Map<String, Object> properties = new HashMap<>();
|
Map<String, Object> properties = new HashMap<>();
|
||||||
properties.put(BluetoothBindingConstants.CONFIGURATION_ADDRESS, device.getAddress().toString());
|
properties.put(BluetoothBindingConstants.CONFIGURATION_ADDRESS, device.getAddress().toString());
|
||||||
properties.put(Thing.PROPERTY_VENDOR, "RadonEye");
|
properties.put(Thing.PROPERTY_VENDOR, "RadonEye");
|
||||||
String name = device.getName();
|
|
||||||
String serialNumber = device.getSerialNumber();
|
String serialNumber = device.getSerialNumber();
|
||||||
String firmwareRevision = device.getFirmwareRevision();
|
String firmwareRevision = device.getFirmwareRevision();
|
||||||
String model = device.getModel();
|
String model = device.getModel();
|
||||||
|
|||||||
@ -112,49 +112,42 @@ public class GrafikEyeHandler extends BaseThingHandler {
|
|||||||
} else {
|
} else {
|
||||||
logger.error("Received a SCENE command with a non DecimalType: {}", command);
|
logger.error("Received a SCENE command with a non DecimalType: {}", command);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (id.equals(PrgConstants.CHANNEL_SCENELOCK)) {
|
} else if (id.equals(PrgConstants.CHANNEL_SCENELOCK)) {
|
||||||
if (command instanceof OnOffType) {
|
if (command instanceof OnOffType) {
|
||||||
getProtocolHandler().setSceneLock(config.getControlUnit(), command == OnOffType.ON);
|
getProtocolHandler().setSceneLock(config.getControlUnit(), command == OnOffType.ON);
|
||||||
} else {
|
} else {
|
||||||
logger.error("Received a SCENELOCK command with a non OnOffType: {}", command);
|
logger.error("Received a SCENELOCK command with a non OnOffType: {}", command);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (id.equals(PrgConstants.CHANNEL_SCENESEQ)) {
|
} else if (id.equals(PrgConstants.CHANNEL_SCENESEQ)) {
|
||||||
if (command instanceof OnOffType) {
|
if (command instanceof OnOffType) {
|
||||||
getProtocolHandler().setSceneSequence(config.getControlUnit(), command == OnOffType.ON);
|
getProtocolHandler().setSceneSequence(config.getControlUnit(), command == OnOffType.ON);
|
||||||
} else {
|
} else {
|
||||||
logger.error("Received a SCENESEQ command with a non OnOffType: {}", command);
|
logger.error("Received a SCENESEQ command with a non OnOffType: {}", command);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (id.equals(PrgConstants.CHANNEL_ZONELOCK)) {
|
} else if (id.equals(PrgConstants.CHANNEL_ZONELOCK)) {
|
||||||
if (command instanceof OnOffType) {
|
if (command instanceof OnOffType) {
|
||||||
getProtocolHandler().setZoneLock(config.getControlUnit(), command == OnOffType.ON);
|
getProtocolHandler().setZoneLock(config.getControlUnit(), command == OnOffType.ON);
|
||||||
} else {
|
} else {
|
||||||
logger.error("Received a ZONELOCK command with a non OnOffType: {}", command);
|
logger.error("Received a ZONELOCK command with a non OnOffType: {}", command);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (id.startsWith(PrgConstants.CHANNEL_ZONELOWER)) {
|
} else if (id.startsWith(PrgConstants.CHANNEL_ZONELOWER)) {
|
||||||
final Integer zone = getTrailingNbr(id, PrgConstants.CHANNEL_ZONELOWER);
|
final Integer zone = getTrailingNbr(id, PrgConstants.CHANNEL_ZONELOWER);
|
||||||
|
|
||||||
if (zone != null) {
|
if (zone != null) {
|
||||||
getProtocolHandler().setZoneLower(config.getControlUnit(), zone);
|
getProtocolHandler().setZoneLower(config.getControlUnit(), zone);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (id.startsWith(PrgConstants.CHANNEL_ZONERAISE)) {
|
} else if (id.startsWith(PrgConstants.CHANNEL_ZONERAISE)) {
|
||||||
final Integer zone = getTrailingNbr(id, PrgConstants.CHANNEL_ZONERAISE);
|
final Integer zone = getTrailingNbr(id, PrgConstants.CHANNEL_ZONERAISE);
|
||||||
|
|
||||||
if (zone != null) {
|
if (zone != null) {
|
||||||
getProtocolHandler().setZoneRaise(config.getControlUnit(), zone);
|
getProtocolHandler().setZoneRaise(config.getControlUnit(), zone);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (id.equals(PrgConstants.CHANNEL_ZONEFADE)) {
|
} else if (id.equals(PrgConstants.CHANNEL_ZONEFADE)) {
|
||||||
if (command instanceof DecimalType) {
|
if (command instanceof DecimalType) {
|
||||||
setFade(((DecimalType) command).intValue());
|
setFade(((DecimalType) command).intValue());
|
||||||
} else {
|
} else {
|
||||||
logger.error("Received a ZONEFADE command with a non DecimalType: {}", command);
|
logger.error("Received a ZONEFADE command with a non DecimalType: {}", command);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (id.startsWith(PrgConstants.CHANNEL_ZONEINTENSITY)) {
|
} else if (id.startsWith(PrgConstants.CHANNEL_ZONEINTENSITY)) {
|
||||||
final Integer zone = getTrailingNbr(id, PrgConstants.CHANNEL_ZONEINTENSITY);
|
final Integer zone = getTrailingNbr(id, PrgConstants.CHANNEL_ZONEINTENSITY);
|
||||||
|
|
||||||
@ -172,7 +165,6 @@ public class GrafikEyeHandler extends BaseThingHandler {
|
|||||||
logger.error("Received a ZONEINTENSITY command with a non DecimalType: {}", command);
|
logger.error("Received a ZONEINTENSITY command with a non DecimalType: {}", command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (id.startsWith(PrgConstants.CHANNEL_ZONESHADE)) {
|
} else if (id.startsWith(PrgConstants.CHANNEL_ZONESHADE)) {
|
||||||
final Integer zone = getTrailingNbr(id, PrgConstants.CHANNEL_ZONESHADE);
|
final Integer zone = getTrailingNbr(id, PrgConstants.CHANNEL_ZONESHADE);
|
||||||
|
|
||||||
@ -190,7 +182,6 @@ public class GrafikEyeHandler extends BaseThingHandler {
|
|||||||
logger.error("Received a ZONEINTENSITY command with a non DecimalType: {}", command);
|
logger.error("Received a ZONEINTENSITY command with a non DecimalType: {}", command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
logger.error("Unknown/Unsupported Channel id: {}", id);
|
logger.error("Unknown/Unsupported Channel id: {}", id);
|
||||||
}
|
}
|
||||||
@ -209,7 +200,6 @@ public class GrafikEyeHandler extends BaseThingHandler {
|
|||||||
|
|
||||||
if (id.equals(PrgConstants.CHANNEL_SCENE)) {
|
if (id.equals(PrgConstants.CHANNEL_SCENE)) {
|
||||||
getProtocolHandler().refreshScene();
|
getProtocolHandler().refreshScene();
|
||||||
|
|
||||||
} else if (id.equals(PrgConstants.CHANNEL_ZONEINTENSITY)) {
|
} else if (id.equals(PrgConstants.CHANNEL_ZONEINTENSITY)) {
|
||||||
getProtocolHandler().refreshZoneIntensity(config.getControlUnit());
|
getProtocolHandler().refreshZoneIntensity(config.getControlUnit());
|
||||||
} else if (id.equals(PrgConstants.CHANNEL_ZONEFADE)) {
|
} else if (id.equals(PrgConstants.CHANNEL_ZONEFADE)) {
|
||||||
|
|||||||
@ -162,10 +162,8 @@ public class PrgBridgeHandler extends BaseBridgeHandler {
|
|||||||
|
|
||||||
if (id.equals(PrgConstants.CHANNEL_ZONELOWERSTOP)) {
|
if (id.equals(PrgConstants.CHANNEL_ZONELOWERSTOP)) {
|
||||||
protocolHandler.setZoneLowerStop();
|
protocolHandler.setZoneLowerStop();
|
||||||
|
|
||||||
} else if (id.equals(PrgConstants.CHANNEL_ZONERAISESTOP)) {
|
} else if (id.equals(PrgConstants.CHANNEL_ZONERAISESTOP)) {
|
||||||
protocolHandler.setZoneRaiseStop();
|
protocolHandler.setZoneRaiseStop();
|
||||||
|
|
||||||
} else if (id.equals(PrgConstants.CHANNEL_TIMECLOCK)) {
|
} else if (id.equals(PrgConstants.CHANNEL_TIMECLOCK)) {
|
||||||
if (command instanceof DateTimeType) {
|
if (command instanceof DateTimeType) {
|
||||||
final ZonedDateTime zdt = ((DateTimeType) command).getZonedDateTime();
|
final ZonedDateTime zdt = ((DateTimeType) command).getZonedDateTime();
|
||||||
@ -180,15 +178,12 @@ public class PrgBridgeHandler extends BaseBridgeHandler {
|
|||||||
} else {
|
} else {
|
||||||
logger.error("Received a SCHEDULE channel command with a non DecimalType: {}", command);
|
logger.error("Received a SCHEDULE channel command with a non DecimalType: {}", command);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (id.startsWith(PrgConstants.CHANNEL_SUPERSEQUENCESTART)) {
|
} else if (id.startsWith(PrgConstants.CHANNEL_SUPERSEQUENCESTART)) {
|
||||||
protocolHandler.startSuperSequence();
|
protocolHandler.startSuperSequence();
|
||||||
|
|
||||||
} else if (id.startsWith(PrgConstants.CHANNEL_SUPERSEQUENCEPAUSE)) {
|
} else if (id.startsWith(PrgConstants.CHANNEL_SUPERSEQUENCEPAUSE)) {
|
||||||
protocolHandler.pauseSuperSequence();
|
protocolHandler.pauseSuperSequence();
|
||||||
} else if (id.startsWith(PrgConstants.CHANNEL_SUPERSEQUENCERESUME)) {
|
} else if (id.startsWith(PrgConstants.CHANNEL_SUPERSEQUENCERESUME)) {
|
||||||
protocolHandler.resumeSuperSequence();
|
protocolHandler.resumeSuperSequence();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
logger.error("Unknown/Unsupported Channel id: {}", id);
|
logger.error("Unknown/Unsupported Channel id: {}", id);
|
||||||
}
|
}
|
||||||
@ -207,16 +202,12 @@ public class PrgBridgeHandler extends BaseBridgeHandler {
|
|||||||
|
|
||||||
if (id.equals(PrgConstants.CHANNEL_TIMECLOCK)) {
|
if (id.equals(PrgConstants.CHANNEL_TIMECLOCK)) {
|
||||||
protocolHandler.refreshTime();
|
protocolHandler.refreshTime();
|
||||||
|
|
||||||
} else if (id.equals(PrgConstants.CHANNEL_SCHEDULE)) {
|
} else if (id.equals(PrgConstants.CHANNEL_SCHEDULE)) {
|
||||||
protocolHandler.refreshSchedule();
|
protocolHandler.refreshSchedule();
|
||||||
|
|
||||||
} else if (id.equals(PrgConstants.CHANNEL_SUNRISE)) {
|
} else if (id.equals(PrgConstants.CHANNEL_SUNRISE)) {
|
||||||
protocolHandler.refreshSunriseSunset();
|
protocolHandler.refreshSunriseSunset();
|
||||||
|
|
||||||
} else if (id.equals(PrgConstants.CHANNEL_SUNSET)) {
|
} else if (id.equals(PrgConstants.CHANNEL_SUNSET)) {
|
||||||
protocolHandler.refreshSunriseSunset();
|
protocolHandler.refreshSunriseSunset();
|
||||||
|
|
||||||
} else if (id.equals(PrgConstants.CHANNEL_SUPERSEQUENCESTATUS)) {
|
} else if (id.equals(PrgConstants.CHANNEL_SUPERSEQUENCESTATUS)) {
|
||||||
protocolHandler.reportSuperSequenceStatus();
|
protocolHandler.reportSuperSequenceStatus();
|
||||||
} else if (id.equals(PrgConstants.CHANNEL_SUPERSEQUENCENEXTSTEP)) {
|
} else if (id.equals(PrgConstants.CHANNEL_SUPERSEQUENCENEXTSTEP)) {
|
||||||
@ -277,7 +268,6 @@ public class PrgBridgeHandler extends BaseBridgeHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Exception during connection attempt", e);
|
logger.error("Exception during connection attempt", e);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -109,6 +109,7 @@ However, many devices share large similarities with existing devices.
|
|||||||
The binding allows to try/test if your new device is working with database files of older devices as well.
|
The binding allows to try/test if your new device is working with database files of older devices as well.
|
||||||
|
|
||||||
There are 3 ways to get unsupported devices working:
|
There are 3 ways to get unsupported devices working:
|
||||||
|
|
||||||
- by overriding the model with the model of a similar supported device. E.g. this works great for roborock vacuum devices and yeelight devices). See [Substitute model for unsupported devices](#substitute-model-for-unsupported-devices)
|
- by overriding the model with the model of a similar supported device. E.g. this works great for roborock vacuum devices and yeelight devices). See [Substitute model for unsupported devices](#substitute-model-for-unsupported-devices)
|
||||||
- by switching on the `(experimental) Create channels for new/unsupported devices (MIOT protocol)` channel, this works for most newer devices. See [Create support for new devices based on online published spec database](#create-support-for-new-devices-based-on-online-published-spec-database)
|
- by switching on the `(experimental) Create channels for new/unsupported devices (MIOT protocol)` channel, this works for most newer devices. See [Create support for new devices based on online published spec database](#create-support-for-new-devices-based-on-online-published-spec-database)
|
||||||
- by switching on the `(experimental) Create channels / test properties for unsupported devices (legacy protocol)` channel. This works for older / legacy devices. It test all known properties to see which are supported by your device. See [Supported property test for unsupported devices](#supported-property-test-for-unsupported-devices)
|
- by switching on the `(experimental) Create channels / test properties for unsupported devices (legacy protocol)` channel. This works for older / legacy devices. It test all known properties to see which are supported by your device. See [Supported property test for unsupported devices](#supported-property-test-for-unsupported-devices)
|
||||||
|
|||||||
@ -109,6 +109,7 @@ However, many devices share large similarities with existing devices.
|
|||||||
The binding allows to try/test if your new device is working with database files of older devices as well.
|
The binding allows to try/test if your new device is working with database files of older devices as well.
|
||||||
|
|
||||||
There are 3 ways to get unsupported devices working:
|
There are 3 ways to get unsupported devices working:
|
||||||
|
|
||||||
- by overriding the model with the model of a similar supported device. E.g. this works great for roborock vacuum devices and yeelight devices). See [Substitute model for unsupported devices](#substitute-model-for-unsupported-devices)
|
- by overriding the model with the model of a similar supported device. E.g. this works great for roborock vacuum devices and yeelight devices). See [Substitute model for unsupported devices](#substitute-model-for-unsupported-devices)
|
||||||
- by switching on the `(experimental) Create channels for new/unsupported devices (MIOT protocol)` channel, this works for most newer devices. See [Create support for new devices based on online published spec database](#create-support-for-new-devices-based-on-online-published-spec-database)
|
- by switching on the `(experimental) Create channels for new/unsupported devices (MIOT protocol)` channel, this works for most newer devices. See [Create support for new devices based on online published spec database](#create-support-for-new-devices-based-on-online-published-spec-database)
|
||||||
- by switching on the `(experimental) Create channels / test properties for unsupported devices (legacy protocol)` channel. This works for older / legacy devices. It test all known properties to see which are supported by your device. See [Supported property test for unsupported devices](#supported-property-test-for-unsupported-devices)
|
- by switching on the `(experimental) Create channels / test properties for unsupported devices (legacy protocol)` channel. This works for older / legacy devices. It test all known properties to see which are supported by your device. See [Supported property test for unsupported devices](#supported-property-test-for-unsupported-devices)
|
||||||
|
|||||||
@ -146,7 +146,6 @@ public class SunspecDiscoveryProcess {
|
|||||||
* @throws EndpointNotInitializedException
|
* @throws EndpointNotInitializedException
|
||||||
*/
|
*/
|
||||||
public void detectModel() {
|
public void detectModel() {
|
||||||
|
|
||||||
if (possibleAddresses.isEmpty()) {
|
if (possibleAddresses.isEmpty()) {
|
||||||
parsingFinished();
|
parsingFinished();
|
||||||
return;
|
return;
|
||||||
@ -189,7 +188,6 @@ public class SunspecDiscoveryProcess {
|
|||||||
* Look for a valid model block at the current base address
|
* Look for a valid model block at the current base address
|
||||||
*/
|
*/
|
||||||
private void lookForModelBlock() {
|
private void lookForModelBlock() {
|
||||||
|
|
||||||
ModbusReadRequestBlueprint request = new ModbusReadRequestBlueprint(slaveId,
|
ModbusReadRequestBlueprint request = new ModbusReadRequestBlueprint(slaveId,
|
||||||
ModbusReadFunctionCode.READ_MULTIPLE_REGISTERS, baseAddress, // Start address
|
ModbusReadFunctionCode.READ_MULTIPLE_REGISTERS, baseAddress, // Start address
|
||||||
MODEL_HEADER_SIZE, // number or words to return
|
MODEL_HEADER_SIZE, // number or words to return
|
||||||
@ -233,7 +231,6 @@ public class SunspecDiscoveryProcess {
|
|||||||
createDiscoveryResult(block);
|
createDiscoveryResult(block);
|
||||||
lookForModelBlock();
|
lookForModelBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -129,7 +129,6 @@ public abstract class AbstractSunSpecHandler extends BaseThingHandler {
|
|||||||
* Start the periodic polling
|
* Start the periodic polling
|
||||||
*/
|
*/
|
||||||
private void startUp() {
|
private void startUp() {
|
||||||
|
|
||||||
connectEndpoint();
|
connectEndpoint();
|
||||||
|
|
||||||
if (comms == null || config == null) {
|
if (comms == null || config == null) {
|
||||||
|
|||||||
@ -38,7 +38,6 @@ public class CommonModelParser extends AbstractBaseParser implements SunspecPars
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonModelBlock parse(ModbusRegisterArray raw) {
|
public CommonModelBlock parse(ModbusRegisterArray raw) {
|
||||||
|
|
||||||
CommonModelBlock block = new CommonModelBlock();
|
CommonModelBlock block = new CommonModelBlock();
|
||||||
|
|
||||||
block.sunSpecDID = extractUInt16(raw, 0, 0);
|
block.sunSpecDID = extractUInt16(raw, 0, 0);
|
||||||
|
|||||||
@ -92,7 +92,6 @@ class QbusMessageDeserializer implements JsonDeserializer<QbusMessageBase> {
|
|||||||
|
|
||||||
if (jsonObject.has("outputs")) {
|
if (jsonObject.has("outputs")) {
|
||||||
jsonOutputs = jsonObject.get("outputs");
|
jsonOutputs = jsonObject.get("outputs");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctd != null && cmd != null) {
|
if (ctd != null && cmd != null) {
|
||||||
@ -115,7 +114,6 @@ class QbusMessageDeserializer implements JsonDeserializer<QbusMessageBase> {
|
|||||||
}
|
}
|
||||||
((QbusMessageListMap) message).setOutputs(outputsList);
|
((QbusMessageListMap) message).setOutputs(outputsList);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
message = new QbusMessageMap();
|
message = new QbusMessageMap();
|
||||||
|
|
||||||
@ -145,7 +143,6 @@ class QbusMessageDeserializer implements JsonDeserializer<QbusMessageBase> {
|
|||||||
if (setpoint != null) {
|
if (setpoint != null) {
|
||||||
message.setSetPoint(setpoint);
|
message.setSetPoint(setpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return message;
|
return message;
|
||||||
|
|||||||
@ -108,7 +108,6 @@ public class HTTPHandler {
|
|||||||
latestTime = iterTime;
|
latestTime = iterTime;
|
||||||
latestData = iterData;
|
latestData = iterData;
|
||||||
} // else - found item is older - nothing to do
|
} // else - found item is older - nothing to do
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
logger.warn("One or two dates cannot be decoded 1) {} 2) {}", iterTimeStr, latestTimeStr);
|
logger.warn("One or two dates cannot be decoded 1) {} 2) {}", iterTimeStr, latestTimeStr);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,6 @@ public class DateTimeUtils {
|
|||||||
public static synchronized @Nullable LocalDateTime toDate(String dateTime) {
|
public static synchronized @Nullable LocalDateTime toDate(String dateTime) {
|
||||||
try {
|
try {
|
||||||
return LocalDateTime.from(DTF.parse(dateTime));
|
return LocalDateTime.from(DTF.parse(dateTime));
|
||||||
|
|
||||||
} catch (DateTimeParseException e) {
|
} catch (DateTimeParseException e) {
|
||||||
LOGGER.debug("Unable to parse date {}", dateTime);
|
LOGGER.debug("Unable to parse date {}", dateTime);
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -289,7 +289,6 @@ public class Shelly2ApiClient extends ShellyHttpClient {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean updated = false;
|
|
||||||
ShellySettingsMeter sm = new ShellySettingsMeter();
|
ShellySettingsMeter sm = new ShellySettingsMeter();
|
||||||
ShellySettingsEMeter emeter = status.emeters.get(0);
|
ShellySettingsEMeter emeter = status.emeters.get(0);
|
||||||
sm.isValid = emeter.isValid = true;
|
sm.isValid = emeter.isValid = true;
|
||||||
|
|||||||
@ -145,9 +145,6 @@ public class ShellyDiscoveryParticipant implements MDNSDiscoveryParticipant {
|
|||||||
try {
|
try {
|
||||||
ShellyApiInterface api = gen2 ? new Shelly2ApiRpc(name, config, httpClient)
|
ShellyApiInterface api = gen2 ? new Shelly2ApiRpc(name, config, httpClient)
|
||||||
: new Shelly1HttpApi(name, config, httpClient);
|
: new Shelly1HttpApi(name, config, httpClient);
|
||||||
if (name.contains("plus1pm")) {
|
|
||||||
int i = 1;
|
|
||||||
}
|
|
||||||
api.initialize();
|
api.initialize();
|
||||||
profile = api.getDeviceProfile(thingType);
|
profile = api.getDeviceProfile(thingType);
|
||||||
api.close();
|
api.close();
|
||||||
|
|||||||
@ -5,9 +5,11 @@ Binding to query a [solarwatt](https://www.solarwatt.de/) [energy manager](https
|
|||||||
All supported values and devices were discovered while playing with my own energy manager.
|
All supported values and devices were discovered while playing with my own energy manager.
|
||||||
|
|
||||||
## Supported devices
|
## Supported devices
|
||||||
|
|
||||||
* Solarwatt Energymanager; ie. the DIN rail mounted device in your house distribution.
|
* Solarwatt Energymanager; ie. the DIN rail mounted device in your house distribution.
|
||||||
|
|
||||||
## Not supported by this binding
|
## Not supported by this binding
|
||||||
|
|
||||||
* Solarwatt Manager/Manager Flex; ie. the black square device that is wall mounted.
|
* Solarwatt Manager/Manager Flex; ie. the black square device that is wall mounted.
|
||||||
|
|
||||||
The Solarwatt Manager already contains an OpenHAB installation which can be connected to
|
The Solarwatt Manager already contains an OpenHAB installation which can be connected to
|
||||||
|
|||||||
@ -289,6 +289,7 @@ public class SonnenHandler extends BaseThingHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("PMD.SimplifyBooleanReturns")
|
||||||
private boolean arePowerMeterChannelsLinked() {
|
private boolean arePowerMeterChannelsLinked() {
|
||||||
if (isLinked(CHANNELENERGYIMPORTEDSTATEPRODUCTION)) {
|
if (isLinked(CHANNELENERGYIMPORTEDSTATEPRODUCTION)) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -135,7 +135,6 @@ public class ApiPageParser extends AbstractSimpleMarkupHandler {
|
|||||||
public void handleStandaloneElement(final @Nullable String elementName,
|
public void handleStandaloneElement(final @Nullable String elementName,
|
||||||
final @Nullable Map<String, String> attributes, final boolean minimized, final int line, final int col)
|
final @Nullable Map<String, String> attributes, final boolean minimized, final int line, final int col)
|
||||||
throws ParseException {
|
throws ParseException {
|
||||||
|
|
||||||
logger.debug("Unexpected StandaloneElement in {}:{}: {} [{}]", line, col, elementName, attributes);
|
logger.debug("Unexpected StandaloneElement in {}:{}: {} [{}]", line, col, elementName, attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,7 +142,6 @@ public class ApiPageParser extends AbstractSimpleMarkupHandler {
|
|||||||
@NonNullByDefault({})
|
@NonNullByDefault({})
|
||||||
public void handleOpenElement(final @Nullable String elementName, final @Nullable Map<String, String> attributes,
|
public void handleOpenElement(final @Nullable String elementName, final @Nullable Map<String, String> attributes,
|
||||||
final int line, final int col) throws ParseException {
|
final int line, final int col) throws ParseException {
|
||||||
|
|
||||||
if (this.parserState == ParserState.INIT && "div".equals(elementName)) {
|
if (this.parserState == ParserState.INIT && "div".equals(elementName)) {
|
||||||
this.parserState = ParserState.DATA_ENTRY;
|
this.parserState = ParserState.DATA_ENTRY;
|
||||||
String classFlags;
|
String classFlags;
|
||||||
@ -272,7 +270,6 @@ public class ApiPageParser extends AbstractSimpleMarkupHandler {
|
|||||||
@Override
|
@Override
|
||||||
public void handleText(final char @Nullable [] buffer, final int offset, final int len, final int line,
|
public void handleText(final char @Nullable [] buffer, final int offset, final int len, final int line,
|
||||||
final int col) throws ParseException {
|
final int col) throws ParseException {
|
||||||
|
|
||||||
if (buffer == null) {
|
if (buffer == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,7 +77,6 @@ public class ChangerX2Parser extends AbstractSimpleMarkupHandler {
|
|||||||
@NonNullByDefault({})
|
@NonNullByDefault({})
|
||||||
public void handleStandaloneElement(final String elementName, final Map<String, String> attributes,
|
public void handleStandaloneElement(final String elementName, final Map<String, String> attributes,
|
||||||
final boolean minimized, final int line, final int col) throws ParseException {
|
final boolean minimized, final int line, final int col) throws ParseException {
|
||||||
|
|
||||||
logger.debug("Error parsing options for {}: Unexpected StandaloneElement in {}{}: {} [{}]", channelName, line,
|
logger.debug("Error parsing options for {}: Unexpected StandaloneElement in {}{}: {} [{}]", channelName, line,
|
||||||
col, elementName, attributes);
|
col, elementName, attributes);
|
||||||
}
|
}
|
||||||
@ -86,7 +85,6 @@ public class ChangerX2Parser extends AbstractSimpleMarkupHandler {
|
|||||||
@NonNullByDefault({})
|
@NonNullByDefault({})
|
||||||
public void handleOpenElement(final String elementName, final Map<String, String> attributes, final int line,
|
public void handleOpenElement(final String elementName, final Map<String, String> attributes, final int line,
|
||||||
final int col) throws ParseException {
|
final int col) throws ParseException {
|
||||||
|
|
||||||
String id = attributes == null ? null : attributes.get("id");
|
String id = attributes == null ? null : attributes.get("id");
|
||||||
|
|
||||||
if (this.parserState == ParserState.INIT && "input".equals(elementName) && "changeadr".equals(id)) {
|
if (this.parserState == ParserState.INIT && "input".equals(elementName) && "changeadr".equals(id)) {
|
||||||
@ -206,7 +204,6 @@ public class ChangerX2Parser extends AbstractSimpleMarkupHandler {
|
|||||||
@Override
|
@Override
|
||||||
public void handleText(final char @Nullable [] buffer, final int offset, final int len, final int line,
|
public void handleText(final char @Nullable [] buffer, final int offset, final int len, final int line,
|
||||||
final int col) throws ParseException {
|
final int col) throws ParseException {
|
||||||
|
|
||||||
if (buffer == null) {
|
if (buffer == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -111,9 +111,10 @@ public enum TapoErrorCode {
|
|||||||
|
|
||||||
public static TapoErrorCode fromCode(int errorCode) {
|
public static TapoErrorCode fromCode(int errorCode) {
|
||||||
for (TapoErrorCode e : TapoErrorCode.values()) {
|
for (TapoErrorCode e : TapoErrorCode.values()) {
|
||||||
if (e.code.equals(errorCode))
|
if (e.code.equals(errorCode)) {
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return ERR_UNKNOWN;
|
return ERR_UNKNOWN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,7 +54,6 @@ import org.openhab.core.thing.type.ChannelKind;
|
|||||||
import org.openhab.core.thing.type.ChannelTypeProvider;
|
import org.openhab.core.thing.type.ChannelTypeProvider;
|
||||||
import org.openhab.core.thing.type.ChannelTypeRegistry;
|
import org.openhab.core.thing.type.ChannelTypeRegistry;
|
||||||
import org.openhab.core.thing.type.ChannelTypeUID;
|
import org.openhab.core.thing.type.ChannelTypeUID;
|
||||||
import org.osgi.service.http.HttpService;
|
|
||||||
import org.osgi.service.http.NamespaceException;
|
import org.osgi.service.http.NamespaceException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -88,7 +87,6 @@ class WundergroundUpdateReceiverDiscoveryServiceTest {
|
|||||||
TestChannelTypeRegistry channelTypeRegistry = new TestChannelTypeRegistry();
|
TestChannelTypeRegistry channelTypeRegistry = new TestChannelTypeRegistry();
|
||||||
WundergroundUpdateReceiverDiscoveryService discoveryService = new WundergroundUpdateReceiverDiscoveryService(
|
WundergroundUpdateReceiverDiscoveryService discoveryService = new WundergroundUpdateReceiverDiscoveryService(
|
||||||
true);
|
true);
|
||||||
HttpService httpService = mock(HttpService.class);
|
|
||||||
WundergroundUpdateReceiverServlet sut = new WundergroundUpdateReceiverServlet(discoveryService);
|
WundergroundUpdateReceiverServlet sut = new WundergroundUpdateReceiverServlet(discoveryService);
|
||||||
discoveryService.addUnhandledStationId(REQ_STATION_ID, sut.normalizeParameterMap(req.getParameterMap()));
|
discoveryService.addUnhandledStationId(REQ_STATION_ID, sut.normalizeParameterMap(req.getParameterMap()));
|
||||||
Thing thing = ThingBuilder.create(SUPPORTED_THING_TYPES_UIDS.stream().findFirst().get(), TEST_THING_UID)
|
Thing thing = ThingBuilder.create(SUPPORTED_THING_TYPES_UIDS.stream().findFirst().get(), TEST_THING_UID)
|
||||||
@ -179,7 +177,6 @@ class WundergroundUpdateReceiverDiscoveryServiceTest {
|
|||||||
TestChannelTypeRegistry channelTypeRegistry = new TestChannelTypeRegistry();
|
TestChannelTypeRegistry channelTypeRegistry = new TestChannelTypeRegistry();
|
||||||
WundergroundUpdateReceiverDiscoveryService discoveryService = new WundergroundUpdateReceiverDiscoveryService(
|
WundergroundUpdateReceiverDiscoveryService discoveryService = new WundergroundUpdateReceiverDiscoveryService(
|
||||||
false);
|
false);
|
||||||
HttpService httpService = mock(HttpService.class);
|
|
||||||
WundergroundUpdateReceiverServlet sut = new WundergroundUpdateReceiverServlet(discoveryService);
|
WundergroundUpdateReceiverServlet sut = new WundergroundUpdateReceiverServlet(discoveryService);
|
||||||
discoveryService.addUnhandledStationId(REQ_STATION_ID, sut.normalizeParameterMap(req.getParameterMap()));
|
discoveryService.addUnhandledStationId(REQ_STATION_ID, sut.normalizeParameterMap(req.getParameterMap()));
|
||||||
Thing thing = ThingBuilder.create(SUPPORTED_THING_TYPES_UIDS.stream().findFirst().get(), TEST_THING_UID)
|
Thing thing = ThingBuilder.create(SUPPORTED_THING_TYPES_UIDS.stream().findFirst().get(), TEST_THING_UID)
|
||||||
@ -225,7 +222,6 @@ class WundergroundUpdateReceiverDiscoveryServiceTest {
|
|||||||
TestChannelTypeRegistry channelTypeRegistry = new TestChannelTypeRegistry();
|
TestChannelTypeRegistry channelTypeRegistry = new TestChannelTypeRegistry();
|
||||||
WundergroundUpdateReceiverDiscoveryService discoveryService = new WundergroundUpdateReceiverDiscoveryService(
|
WundergroundUpdateReceiverDiscoveryService discoveryService = new WundergroundUpdateReceiverDiscoveryService(
|
||||||
true);
|
true);
|
||||||
HttpService httpService = mock(HttpService.class);
|
|
||||||
WundergroundUpdateReceiverServlet sut = new WundergroundUpdateReceiverServlet(discoveryService);
|
WundergroundUpdateReceiverServlet sut = new WundergroundUpdateReceiverServlet(discoveryService);
|
||||||
discoveryService.addUnhandledStationId(REQ_STATION_ID, sut.normalizeParameterMap(req1.getParameterMap()));
|
discoveryService.addUnhandledStationId(REQ_STATION_ID, sut.normalizeParameterMap(req1.getParameterMap()));
|
||||||
Thing thing = ThingBuilder.create(SUPPORTED_THING_TYPES_UIDS.stream().findFirst().get(), TEST_THING_UID)
|
Thing thing = ThingBuilder.create(SUPPORTED_THING_TYPES_UIDS.stream().findFirst().get(), TEST_THING_UID)
|
||||||
@ -292,7 +288,6 @@ class WundergroundUpdateReceiverDiscoveryServiceTest {
|
|||||||
TestChannelTypeRegistry channelTypeRegistry = new TestChannelTypeRegistry();
|
TestChannelTypeRegistry channelTypeRegistry = new TestChannelTypeRegistry();
|
||||||
WundergroundUpdateReceiverDiscoveryService discoveryService = new WundergroundUpdateReceiverDiscoveryService(
|
WundergroundUpdateReceiverDiscoveryService discoveryService = new WundergroundUpdateReceiverDiscoveryService(
|
||||||
true);
|
true);
|
||||||
HttpService httpService = mock(HttpService.class);
|
|
||||||
WundergroundUpdateReceiverServlet sut = new WundergroundUpdateReceiverServlet(discoveryService);
|
WundergroundUpdateReceiverServlet sut = new WundergroundUpdateReceiverServlet(discoveryService);
|
||||||
discoveryService.addUnhandledStationId(REQ_STATION_ID, sut.normalizeParameterMap(req1.getParameterMap()));
|
discoveryService.addUnhandledStationId(REQ_STATION_ID, sut.normalizeParameterMap(req1.getParameterMap()));
|
||||||
Thing thing = ThingBuilder.create(SUPPORTED_THING_TYPES_UIDS.stream().findFirst().get(), TEST_THING_UID)
|
Thing thing = ThingBuilder.create(SUPPORTED_THING_TYPES_UIDS.stream().findFirst().get(), TEST_THING_UID)
|
||||||
@ -356,7 +351,6 @@ class WundergroundUpdateReceiverDiscoveryServiceTest {
|
|||||||
UpdatingChannelTypeRegistry channelTypeRegistry = new UpdatingChannelTypeRegistry();
|
UpdatingChannelTypeRegistry channelTypeRegistry = new UpdatingChannelTypeRegistry();
|
||||||
WundergroundUpdateReceiverDiscoveryService discoveryService = new WundergroundUpdateReceiverDiscoveryService(
|
WundergroundUpdateReceiverDiscoveryService discoveryService = new WundergroundUpdateReceiverDiscoveryService(
|
||||||
true);
|
true);
|
||||||
HttpService httpService = mock(HttpService.class);
|
|
||||||
WundergroundUpdateReceiverServlet sut = new WundergroundUpdateReceiverServlet(discoveryService);
|
WundergroundUpdateReceiverServlet sut = new WundergroundUpdateReceiverServlet(discoveryService);
|
||||||
discoveryService.addUnhandledStationId(REQ_STATION_ID, sut.normalizeParameterMap(req1.getParameterMap()));
|
discoveryService.addUnhandledStationId(REQ_STATION_ID, sut.normalizeParameterMap(req1.getParameterMap()));
|
||||||
Thing thing = ThingBuilder.create(SUPPORTED_THING_TYPES_UIDS.stream().findFirst().get(), TEST_THING_UID)
|
Thing thing = ThingBuilder.create(SUPPORTED_THING_TYPES_UIDS.stream().findFirst().get(), TEST_THING_UID)
|
||||||
|
|||||||
@ -789,7 +789,6 @@ public class ModbusPollerThingHandlerTest extends AbstractModbusOSGiTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testRefreshWithOldPreviousData() throws IllegalArgumentException, IllegalAccessException,
|
public void testRefreshWithOldPreviousData() throws IllegalArgumentException, IllegalAccessException,
|
||||||
NoSuchFieldException, SecurityException, InterruptedException {
|
NoSuchFieldException, SecurityException, InterruptedException {
|
||||||
|
|
||||||
Configuration pollerConfig = new Configuration();
|
Configuration pollerConfig = new Configuration();
|
||||||
pollerConfig.put("refresh", 0L);
|
pollerConfig.put("refresh", 0L);
|
||||||
pollerConfig.put("start", 5);
|
pollerConfig.put("start", 5);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user