mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
Reduce SAT warnings (#17406)
* Reduce SAT warnings Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
parent
2d61ffc409
commit
54fd13b0c1
@ -26,7 +26,7 @@
|
||||
<parameter name="gems" type="text" required="false" groupName="gems">
|
||||
<label>Ruby Gems</label>
|
||||
<description><![CDATA[A comma separated list of Ruby Gems to install. Versions may be constrained by separating with an
|
||||
<tt>=</tt> and then the standard RubyGems version constraint, such as "<tt>openhab-scripting=~>5.0</tt>".
|
||||
<tt>=</tt> and then the standard RubyGems version constraint, such as "<tt>openhab-scripting=~>5.0</tt>".
|
||||
]]></description>
|
||||
<default>openhab-scripting=~>5.0.0</default>
|
||||
</parameter>
|
||||
|
@ -38,7 +38,7 @@ public class DynamicChannelHelper {
|
||||
private record ConfigurationChannel(String id, String typeId, String itemType) {
|
||||
}
|
||||
|
||||
private final static List<ConfigurationChannel> channels = new ArrayList<ConfigurationChannel>() {
|
||||
private static final List<ConfigurationChannel> CHANNELS = new ArrayList<ConfigurationChannel>() {
|
||||
{
|
||||
add(new ConfigurationChannel(CHANNEL_COUNTRY_CODE, CHANNEL_COUNTRY_CODE, "String"));
|
||||
add(new ConfigurationChannel(CHANNEL_PM_STANDARD, CHANNEL_PM_STANDARD, "String"));
|
||||
@ -58,10 +58,10 @@ public class DynamicChannelHelper {
|
||||
}
|
||||
};
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(DynamicChannelHelper.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(DynamicChannelHelper.class);
|
||||
|
||||
public static ThingBuilder updateThingWithConfigurationChannels(Thing thing, ThingBuilder builder) {
|
||||
for (ConfigurationChannel channel : channels) {
|
||||
for (ConfigurationChannel channel : CHANNELS) {
|
||||
addLocalConfigurationChannel(thing, builder, channel);
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,12 @@ import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.binding.astro.internal.calc.SunCalc;
|
||||
import org.openhab.binding.astro.internal.job.DailyJobSun;
|
||||
import org.openhab.binding.astro.internal.job.Job;
|
||||
import org.openhab.binding.astro.internal.model.*;
|
||||
import org.openhab.binding.astro.internal.model.Planet;
|
||||
import org.openhab.binding.astro.internal.model.Position;
|
||||
import org.openhab.binding.astro.internal.model.Radiation;
|
||||
import org.openhab.binding.astro.internal.model.Range;
|
||||
import org.openhab.binding.astro.internal.model.Sun;
|
||||
import org.openhab.binding.astro.internal.model.SunPhaseName;
|
||||
import org.openhab.core.i18n.TimeZoneProvider;
|
||||
import org.openhab.core.scheduler.CronScheduler;
|
||||
import org.openhab.core.thing.Thing;
|
||||
|
@ -207,7 +207,6 @@ public class AwattarBridgeHandler extends BaseBridgeHandler {
|
||||
|
||||
// refresh then every 3 hours, if the last refresh was more than an hour ago
|
||||
if (now.getHour() % 3 == 0 && lastRefresh.getEpochSecond() < now.minusHours(1).toEpochSecond()) {
|
||||
|
||||
// update the last refresh time
|
||||
lastRefresh = Instant.now();
|
||||
|
||||
|
@ -73,7 +73,6 @@ class AwattarBridgeHandlerRefreshTest extends JavaTest {
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws IllegalArgumentException, IllegalAccessException {
|
||||
|
||||
when(timeZoneProviderMock.getTimeZone()).thenReturn(ZoneId.of("GMT+2"));
|
||||
|
||||
when(bridgeMock.getUID()).thenReturn(BRIDGE_UID);
|
||||
|
@ -95,7 +95,6 @@ public class AwattarBridgeHandlerTest extends JavaTest {
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws IOException, IllegalArgumentException, IllegalAccessException, AwattarApiException {
|
||||
|
||||
// mock the API response
|
||||
try (InputStream inputStream = AwattarBridgeHandlerTest.class.getResourceAsStream("api_response.json")) {
|
||||
SortedSet<AwattarPrice> result = new TreeSet<>(Comparator.comparing(AwattarPrice::timerange));
|
||||
|
@ -28,7 +28,7 @@ import org.slf4j.LoggerFactory;
|
||||
* The {@link AirthingsWaveGen1Handler} is responsible for handling commands, which are
|
||||
* sent to one of the channels.
|
||||
*
|
||||
* @author Davy Wong - Added Airthings Wave Gen 1 support
|
||||
* @author Davy Wong - initial contribution, added Airthings Wave Gen 1 support
|
||||
*/
|
||||
@NonNullByDefault
|
||||
public class AirthingsWaveGen1Handler extends AbstractAirthingsHandler {
|
||||
|
@ -91,7 +91,6 @@ public class MadokaValue {
|
||||
// unsupported
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ import org.slf4j.LoggerFactory;
|
||||
/**
|
||||
* The {@link BluetoothChannelUtils} contains utility functions used by the GattChannelHandler
|
||||
*
|
||||
* @author Vlad Kolotov - Original author
|
||||
* @author Vlad Kolotov - Initial contribution
|
||||
* @author Connor Petty - Modified for openHAB use
|
||||
*/
|
||||
@NonNullByDefault
|
||||
@ -75,11 +75,11 @@ public class BluetoothChannelUtils {
|
||||
case SINT:
|
||||
case FLOAT_IEE754:
|
||||
case FLOAT_IEE11073:
|
||||
BluetoothUnit unit = BluetoothUnit.findByType(field.getUnit());
|
||||
if (unit != null) {
|
||||
// TODO
|
||||
// return "Number:" + unit.getUnit().getDimension();
|
||||
}
|
||||
// BluetoothUnit unit = BluetoothUnit.findByType(field.getUnit());
|
||||
// if (unit != null) {
|
||||
// TODO
|
||||
// return "Number:" + unit.getUnit().getDimension();
|
||||
// }
|
||||
return "Number";
|
||||
case UTF8S:
|
||||
case UTF16S:
|
||||
@ -208,7 +208,7 @@ public class BluetoothChannelUtils {
|
||||
if (decimalType != null) {
|
||||
try {
|
||||
return field.getEnumeration(new BigInteger(decimalType.toString()));
|
||||
} catch (NumberFormatException ex) {
|
||||
} catch (NumberFormatException ignored) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ import org.slf4j.LoggerFactory;
|
||||
/**
|
||||
* {@link CharacteristicChannelTypeProvider} that provides channel types for dynamically discovered characteristics.
|
||||
*
|
||||
* @author Vlad Kolotov - Original author
|
||||
* @author Vlad Kolotov - Initial contribution
|
||||
* @author Connor Petty - Modified for openHAB use.
|
||||
*/
|
||||
@NonNullByDefault
|
||||
|
@ -47,7 +47,7 @@ import gnu.io.UnsupportedCommOperationException;
|
||||
* Driver for the CM11 X10 interface.
|
||||
*
|
||||
*
|
||||
* @author Anthony Green - Original code
|
||||
* @author Anthony Green - Initial contribution
|
||||
* @author Bob Raker - updates to setClock code, adapted code for use in openHAB2
|
||||
* @see <a href="http://www.heyu.org/docs/protocol.txt">CM11 Protocol specification</a>
|
||||
* @see <a href="http://www.rxtx.org">RXTX Serial API for Java</a>
|
||||
|
@ -113,7 +113,6 @@ public class SceneDiscoveryService extends AbstractDiscoveryService {
|
||||
.withBridge(bridgeUID).withLabel(scene.getSceneName()).build();
|
||||
|
||||
thingDiscovered(discoveryResult);
|
||||
|
||||
} else {
|
||||
logger.debug("discovered unsupported scene: name '{}' with id {}", scene.getSceneName(),
|
||||
scene.getID());
|
||||
|
@ -47,8 +47,8 @@ import org.slf4j.LoggerFactory;
|
||||
* For that it uses the {@link BridgeHandler} to register this class as a {@link DeviceStatusListener} to get informed
|
||||
* about changes from the accompanying {@link Circuit}.
|
||||
*
|
||||
* @author Michael Ochel
|
||||
* @author Matthias Siegele
|
||||
* @author Michael Ochel - Initial contribution
|
||||
* @author Matthias Siegele - Initial contribution
|
||||
*/
|
||||
public class CircuitHandler extends BaseThingHandler implements DeviceStatusListener {
|
||||
|
||||
|
@ -16,8 +16,8 @@ package org.openhab.binding.digitalstrom.internal.lib.serverconnection.constants
|
||||
* The {@link JSONApiResponseKeysEnum} contains digitalSTROM-JSON response keys.
|
||||
*
|
||||
* @author Alexander Betker - Initial contribution
|
||||
* @author Michael Ochel completely changed and updated only methods remained
|
||||
* @author Matthias Siegele completely changed and updated only methods remained
|
||||
* @author Michael Ochel - completely changed and updated only methods remained
|
||||
* @author Matthias Siegele - completely changed and updated only methods remained
|
||||
*/
|
||||
public enum JSONApiResponseKeysEnum {
|
||||
|
||||
|
@ -112,7 +112,7 @@ public class ControllerHandler extends DraytonWiserThingHandler<ControllerData>
|
||||
}
|
||||
|
||||
private State getHeatChannel1Demand() {
|
||||
return getData().heatingChannels.size() >= 1
|
||||
return !getData().heatingChannels.isEmpty()
|
||||
? new QuantityType<>(getData().heatingChannels.get(0).getPercentageDemand(), Units.PERCENT)
|
||||
: UnDefType.UNDEF;
|
||||
}
|
||||
@ -124,7 +124,7 @@ public class ControllerHandler extends DraytonWiserThingHandler<ControllerData>
|
||||
}
|
||||
|
||||
private State getHeatChannel1DemandState() {
|
||||
return OnOffType.from(getData().heatingChannels.size() >= 1
|
||||
return OnOffType.from(!getData().heatingChannels.isEmpty()
|
||||
&& "ON".equalsIgnoreCase(getData().heatingChannels.get(0).getHeatingRelayState()));
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ public class HotWaterHandler extends DraytonWiserThingHandler<HotWaterData> {
|
||||
}
|
||||
|
||||
private State getBoostedState() {
|
||||
if (getData().hotWater.size() >= 1) {
|
||||
if (!getData().hotWater.isEmpty()) {
|
||||
final HotWaterDTO firstChannel = getData().hotWater.get(0);
|
||||
|
||||
if (firstChannel.getOverrideTimeoutUnixTime() != null
|
||||
@ -125,7 +125,7 @@ public class HotWaterHandler extends DraytonWiserThingHandler<HotWaterData> {
|
||||
}
|
||||
|
||||
private State getBoostRemainingState() {
|
||||
if (getData().hotWater.size() >= 1) {
|
||||
if (!getData().hotWater.isEmpty()) {
|
||||
final HotWaterDTO firstChannel = getData().hotWater.get(0);
|
||||
final Integer overrideTimeout = firstChannel.getOverrideTimeoutUnixTime();
|
||||
|
||||
|
@ -121,7 +121,6 @@ public class GenericResponseTransformer {
|
||||
// call the custom handler to handle specific / composite channels which do not map 1:1 to JSON
|
||||
// fields.
|
||||
result.putAll(customResponseTransformer.transform(channel, value, jsonData));
|
||||
|
||||
} catch (NumberFormatException | DateTimeParseException ex) {
|
||||
logger.warn("caught exception while parsing data for channel {} (value '{}'). Exception: {}",
|
||||
channel.getUID().getId(), value, ex.getMessage());
|
||||
|
@ -328,7 +328,6 @@ public class EmotivaProcessorHandler extends BaseThingHandler {
|
||||
if (object instanceof EmotivaAckDTO answerDto) {
|
||||
// Currently not supported to revert a failed command update, just used for logging for now.
|
||||
logger.trace("Processing received '{}' with '{}'", EmotivaAckDTO.class.getSimpleName(), answerDto);
|
||||
|
||||
} else if (object instanceof EmotivaBarNotifyWrapper answerDto) {
|
||||
logger.trace("Processing received '{}' with '{}'", EmotivaBarNotifyWrapper.class.getSimpleName(),
|
||||
emotivaUdpResponse.answer());
|
||||
|
@ -438,14 +438,14 @@
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="autoOFF" advanced="true">
|
||||
<item-type>Number:Duration</item-type>
|
||||
<item-type>Number:Time</item-type>
|
||||
<label>Auto Off</label>
|
||||
<description>Automatically switch to off</description>
|
||||
<state pattern="%d %unit%"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="delayRadioOFF" advanced="true">
|
||||
<item-type>Number:Duration</item-type>
|
||||
<item-type>Number:Time</item-type>
|
||||
<label>Delay Radio Off</label>
|
||||
<description>Delay switch off by radio for given seconds</description>
|
||||
<state pattern="%d %unit%"/>
|
||||
|
@ -79,7 +79,6 @@ public class EnvoyEntrezConnector extends EnvoyConnector {
|
||||
check(configuration.password, "Password parameter is empty"),
|
||||
check(configuration.siteName, "siteName parameter is empty"))
|
||||
.filter(s -> !s.isEmpty()).collect(Collectors.joining(", "));
|
||||
|
||||
}
|
||||
if (!message.isEmpty()) {
|
||||
return message;
|
||||
|
@ -3,7 +3,7 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0"
|
||||
xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0
|
||||
https://openhab.org/schemas/config-description-1.0.0.xsd">
|
||||
https://openhab.org/schemas/config-description-1.0.0.xsd">
|
||||
|
||||
<config-description uri="bridge-type:freeboxos:api">
|
||||
<parameter name="apiDomain" type="text">
|
||||
|
@ -22,8 +22,8 @@ import org.eclipse.jetty.client.HttpClient;
|
||||
* Class representing an internet radio based on the frontier silicon chipset. Tested with "hama IR110" and Medion
|
||||
* MD87180" internet radios.
|
||||
*
|
||||
* @author Rainer Ostendorf
|
||||
* @author Patrick Koenemann
|
||||
* @author Rainer Ostendorf - Initial contribution
|
||||
* @author Patrick Koenemann - improvements
|
||||
* @author Mihaela Memova - removed duplicated check for the percent value range
|
||||
*/
|
||||
public class FrontierSiliconRadio {
|
||||
|
@ -43,8 +43,8 @@ import org.xml.sax.SAXException;
|
||||
*
|
||||
* This class parses this XML data and provides functions for reading and casting typical fields.
|
||||
*
|
||||
* @author Rainer Ostendorf
|
||||
* @author Patrick Koenemann
|
||||
* @author Rainer Ostendorf - Initial contribution
|
||||
* @author Patrick Koenemann - Improvements
|
||||
*
|
||||
*/
|
||||
public class FrontierSiliconRadioApiResult {
|
||||
|
@ -26,8 +26,8 @@ import org.slf4j.LoggerFactory;
|
||||
/**
|
||||
* This class holds the http-connection and session information for controlling the radio.
|
||||
*
|
||||
* @author Rainer Ostendorf
|
||||
* @author Patrick Koenemann
|
||||
* @author Rainer Ostendorf - Initial contribution
|
||||
* @author Patrick Koenemann - improvements
|
||||
* @author Svilen Valkanov - replaced Apache HttpClient with Jetty
|
||||
* @author Mihaela Memova - changed the calling of the stopHttpClient() method, fixed the hardcoded URL path, fixed the
|
||||
* for loop condition part
|
||||
@ -110,7 +110,6 @@ public class FrontierSiliconRadioConnection {
|
||||
isLoggedIn = true;
|
||||
return true; // login successful :-)
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.debug("Fatal transport error: {}", e.toString());
|
||||
throw new IOException(e);
|
||||
|
@ -15,7 +15,7 @@ package org.openhab.binding.fsinternetradio.internal.radio;
|
||||
/**
|
||||
* Internal constants for the frontier silicon radio.
|
||||
*
|
||||
* @author Markus Rathgeb - Moved the constants to separate class
|
||||
* @author Markus Rathgeb - Initial contribution, moved the constants to separate class
|
||||
*/
|
||||
public class FrontierSiliconRadioConstants {
|
||||
|
||||
|
@ -154,7 +154,6 @@ public class GroupePSAHandler extends BaseThingHandler {
|
||||
this.onlineIntervalM = onlineIntervalM != null ? onlineIntervalM : DEFAULT_ONLINE_INTERVAL_M;
|
||||
startGroupePSAPolling(pollingIntervalM);
|
||||
}
|
||||
|
||||
} else {
|
||||
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
|
||||
}
|
||||
@ -359,7 +358,6 @@ public class GroupePSAHandler extends BaseThingHandler {
|
||||
Charging::getRemainingTime, x -> new BigDecimal(x.getSeconds()), Units.SECOND);
|
||||
updateState(CHANNEL_ELECTRIC_CHARGING_NEXTDELAYEDTIME, energy, Energy::getCharging,
|
||||
Charging::getNextDelayedTime, x -> new BigDecimal(x.getSeconds()), Units.SECOND);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -508,7 +508,6 @@ public class GrowattCloud implements AutoCloseable {
|
||||
|
||||
DeviceType deviceType = getDeviceTypeChecked(deviceId);
|
||||
switch (deviceType) {
|
||||
|
||||
case MIX:
|
||||
case SPA:
|
||||
setTimeProgram(deviceId, deviceType,
|
||||
|
@ -23,7 +23,7 @@ import org.openhab.core.i18n.ConfigurationException;
|
||||
/**
|
||||
* Handles the authentication to Homematic server.
|
||||
*
|
||||
* @author Christian Kittel
|
||||
* @author Christian Kittel - Initial contribution
|
||||
*/
|
||||
@NonNullByDefault
|
||||
public class AuthenticationHandler {
|
||||
|
@ -123,7 +123,6 @@ public class HomematicDeviceDiscoveryService
|
||||
thingHandler.getGateway().setInstallMode(false, 0);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
logger.warn("Failed to disable Homematic controller's install mode", ex);
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ public abstract class HomeWizardDeviceHandler extends BaseThingHandler {
|
||||
*
|
||||
* @param payload The data parsed from the data Json file
|
||||
*/
|
||||
abstract protected void handleDataPayload(DataPayload payload);
|
||||
protected abstract void handleDataPayload(DataPayload payload);
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -47,7 +47,7 @@ public abstract class HomeWizardStatefulDeviceHandler extends HomeWizardDeviceHa
|
||||
*
|
||||
* @param payload The data parsed from the state Json file
|
||||
*/
|
||||
abstract protected void handleStatePayload(StatePayload payload);
|
||||
protected abstract void handleStatePayload(StatePayload payload);
|
||||
|
||||
protected void pollState() {
|
||||
final String stateResult;
|
||||
|
@ -119,7 +119,7 @@ public class Clip2BridgeHandler extends BaseBridgeHandler {
|
||||
private final Bundle bundle;
|
||||
private final LocaleProvider localeProvider;
|
||||
private final TranslationProvider translationProvider;
|
||||
private final Map<String, Resource> automationsCache = new ConcurrentHashMap<>();;
|
||||
private final Map<String, Resource> automationsCache = new ConcurrentHashMap<>();
|
||||
private final Set<String> automationScriptIds = ConcurrentHashMap.newKeySet();
|
||||
private final ChannelGroupUID automationChannelGroupUID;
|
||||
|
||||
@ -853,7 +853,6 @@ public class Clip2BridgeHandler extends BaseBridgeHandler {
|
||||
Resource cachedAutomation = automationsCache.get(automation.getId());
|
||||
return Objects.isNull(cachedAutomation) || !automation.getName().equals(cachedAutomation.getName());
|
||||
})) {
|
||||
|
||||
synchronized (automationsCache) {
|
||||
automationsCache.clear();
|
||||
automationsCache.putAll(automations.stream().collect(Collectors.toMap(a -> a.getId(), a -> a)));
|
||||
|
@ -140,7 +140,6 @@ public class ICloudDeviceHandler extends BaseThingHandler implements ICloudDevic
|
||||
if (channelId.equals(FIND_MY_PHONE)) {
|
||||
if (command == OnOffType.ON) {
|
||||
try {
|
||||
|
||||
if (deviceInformationRecord == null) {
|
||||
this.logger
|
||||
.debug("Can't send Find My Device request, because deviceInformationRecord is null!");
|
||||
|
@ -117,7 +117,6 @@ public class PushButtonToCommandProfile implements TriggerProfile {
|
||||
logger.warn("Parameter '{}' is not a valid command type, using default value '{}'", param, defValue);
|
||||
retval = defValue;
|
||||
}
|
||||
|
||||
} else {
|
||||
logger.debug("Parameter '{}' is not of type String, using default value '{}'", param, defValue);
|
||||
retval = defValue;
|
||||
|
@ -444,7 +444,6 @@ public class Port {
|
||||
logger.trace("retransmitting msg: {}", msg);
|
||||
ioStream.write(msg.getData());
|
||||
}
|
||||
|
||||
}
|
||||
// if rate limited, need to sleep now.
|
||||
if (msg.getQuietTime() > 0) {
|
||||
|
@ -819,7 +819,7 @@
|
||||
<state readOnly="true" pattern="%.0f %unit%"/>
|
||||
</channel-type>
|
||||
<channel-type id="device-local-battery-voltage">
|
||||
<item-type>Number:ElectricalPotential</item-type>
|
||||
<item-type>Number:ElectricPotential</item-type>
|
||||
<label>Battery Voltage</label>
|
||||
<description>Current battery voltage</description>
|
||||
<category>Energy</category>
|
||||
|
@ -194,7 +194,7 @@ public class CloudConnector {
|
||||
try {
|
||||
JsonObject homelistInfo = cl.getHomeList(country.trim().toLowerCase());
|
||||
final HomeListDTO homelist = GSON.fromJson(homelistInfo, HomeListDTO.class);
|
||||
if (homelist != null && homelist.getHomelist() != null && homelist.getHomelist().size() > 0) {
|
||||
if (homelist != null && homelist.getHomelist() != null && !homelist.getHomelist().isEmpty()) {
|
||||
homeLists.put(country, homelist);
|
||||
}
|
||||
} catch (JsonSyntaxException e) {
|
||||
|
@ -323,7 +323,6 @@ public class ModbusDataThingHandler extends BaseThingHandler {
|
||||
int writeStartRelative = writeStart - pollStart;
|
||||
data = new ModbusRegisterArray(allMutatedBytes[writeStartRelative * 2],
|
||||
allMutatedBytes[writeStartRelative * 2 + 1]);
|
||||
|
||||
} else {
|
||||
data = ModbusBitUtilities.commandToRegisters(transformedCommand, writeValueType);
|
||||
}
|
||||
|
@ -157,7 +157,6 @@ public class ModbusGainOffsetProfile<Q extends Quantity<Q>> implements StateProf
|
||||
result = applyGainTowardsItem(offsetted, gain);
|
||||
} else {
|
||||
result = applyGainTowardsHandler(quantityState, gain).subtract(pregainOffsetQt);
|
||||
|
||||
}
|
||||
} catch (UnconvertibleException | UnsupportedOperationException e) {
|
||||
logger.warn(
|
||||
|
@ -48,7 +48,7 @@
|
||||
<br />Any other value than the above types will be interpreted as static text, in which case the actual content of the polled
|
||||
value is ignored.
|
||||
<br />Multiple transformations can be chained by listing each transformation on a separate line,
|
||||
or by concatenating them with "∩", for example SERVICE1(ARG1)∩SERVICE2(ARG2)]]></description>
|
||||
or by concatenating them with "∩", for example SERVICE1(ARG1)∩SERVICE2(ARG2)]]></description>
|
||||
<default>default</default>
|
||||
</parameter>
|
||||
<parameter name="readValueType" type="text">
|
||||
@ -103,9 +103,9 @@
|
||||
<br /><br />Use "default" to communicate that no transformation is done and value should be passed as is.
|
||||
<br />Use SERVICENAME(ARG) or SERVICENAME:ARG to use transformation service.
|
||||
<br />Any other value than the above types will be interpreted as static text, in which case the actual content of the command
|
||||
value is ignored.
|
||||
value is ignored.
|
||||
<br />Multiple transformations can be chained by listing each transformation on a separate line,
|
||||
or by concatenating them with "∩", for example SERVICE1(ARG1)∩SERVICE2(ARG2)]]></description>
|
||||
or by concatenating them with "∩", for example SERVICE1(ARG1)∩SERVICE2(ARG2)]]></description>
|
||||
<default>default</default>
|
||||
</parameter>
|
||||
<parameter name="writeValueType" type="text">
|
||||
|
@ -50,7 +50,7 @@
|
||||
<parameter name="duvThreshold" type="decimal" required="true" min="0" max="1" step="0.001">
|
||||
<label>Duv Threshold</label>
|
||||
<description><![CDATA[
|
||||
Duv values at or below this value on a RGBWW color control will trigger white mode at the appropriate color temperature.
|
||||
Duv values at or below this value on a RGBWW color control will trigger white mode at the appropriate color temperature.
|
||||
1 will effectively disable this feature.
|
||||
See <a href="https://www.waveformlighting.com/tech/calculate-duv-from-cie-1931-xy-coordinates/">this link</a> for more information on how this is calculated.
|
||||
]]>
|
||||
|
@ -364,7 +364,6 @@ public class ChannelState implements MqttMessageSubscriber {
|
||||
// Only pass numeric value for QuantityType.
|
||||
if (mqttCommandValue instanceof QuantityType<?> qtCommandValue) {
|
||||
cValue = new DecimalType(qtCommandValue.toBigDecimal());
|
||||
|
||||
}
|
||||
String commandString = mqttFormatter.getMQTTpublishValue(cValue, "%s");
|
||||
Optional<String> transformedValue = outgoingTransformation.apply(commandString);
|
||||
|
@ -10,11 +10,11 @@
|
||||
<label>Publish Online Status</label>
|
||||
<default>true</default>
|
||||
<description><![CDATA[
|
||||
Publish <tt>online</tt> to <tt>homeassistant/status</tt> when discovering Home Assistant
|
||||
things in order to trigger devices to publish up-to-date discovery information.
|
||||
If you also run Home Assistant <i>and</i> other services that depend on knowing if Home
|
||||
Assistant is not running, then it's possible for those services to be out-of-sync with
|
||||
the actual status of Home Assistant, and you may want to disable this.
|
||||
Publish <tt>online</tt> to <tt>homeassistant/status</tt> when discovering Home Assistant
|
||||
things in order to trigger devices to publish up-to-date discovery information.
|
||||
If you also run Home Assistant <i>and</i> other services that depend on knowing if Home
|
||||
Assistant is not running, then it's possible for those services to be out-of-sync with
|
||||
the actual status of Home Assistant, and you may want to disable this.
|
||||
]]></description>
|
||||
</parameter>
|
||||
|
||||
|
@ -114,7 +114,6 @@ public class GatewayPayloadParser {
|
||||
// below
|
||||
// The payload length (might depend on format version ) is validated by parser.parse call
|
||||
throw new IllegalArgumentException("Manufacturerer data is too short");
|
||||
|
||||
}
|
||||
if ((bytes[4] & 0xff) != 0xff) {
|
||||
logger.debug("Data is not representing manufacturer specific bluetooth advertisement: {}",
|
||||
|
@ -291,7 +291,7 @@ public class MyBMWTokenController {
|
||||
UrlEncoded.decodeTo(encodedUrl, tokenMap, StandardCharsets.US_ASCII);
|
||||
final StringBuilder codeFound = new StringBuilder();
|
||||
tokenMap.forEach((key, value) -> {
|
||||
if (value.size() > 0) {
|
||||
if (!value.isEmpty()) {
|
||||
String val = value.get(0);
|
||||
if (key.endsWith(CODE) && (val != null)) {
|
||||
codeFound.append(val.toString());
|
||||
|
@ -51,7 +51,6 @@ public class Utils {
|
||||
int button = (address >> 21) & 0x07;
|
||||
|
||||
return leftPadWithZeros(Integer.toHexString(nikobusAddress), 6) + ":" + mapButton(button);
|
||||
|
||||
} catch (NumberFormatException e) {
|
||||
return "[" + addressString + "]";
|
||||
}
|
||||
|
@ -48,7 +48,6 @@ public class NapierCityCouncil implements WaterWebService {
|
||||
switch (region.toLowerCase()) {
|
||||
case "napier":
|
||||
return HOSTNAME + REGION_NAPIER;
|
||||
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
@ -382,7 +382,7 @@ class OpenSprinklerHttpApiV100 implements OpenSprinklerApi {
|
||||
ContentResponse response = null;
|
||||
int retriesLeft = Math.max(1, config.retry);
|
||||
boolean connectionSuccess = false;
|
||||
while (connectionSuccess == false && retriesLeft > 0) {
|
||||
while (!connectionSuccess && retriesLeft > 0) {
|
||||
retriesLeft--;
|
||||
try {
|
||||
response = withGeneralProperties(httpClient.newRequest(location))
|
||||
@ -393,7 +393,7 @@ class OpenSprinklerHttpApiV100 implements OpenSprinklerApi {
|
||||
e.getMessage());
|
||||
}
|
||||
}
|
||||
if (connectionSuccess == false) {
|
||||
if (!connectionSuccess) {
|
||||
throw new CommunicationApiException("Request to OpenSprinkler device failed");
|
||||
}
|
||||
if (response != null && response.getStatus() != HTTP_OK_CODE) {
|
||||
|
@ -79,7 +79,6 @@ public class PHCHandler extends BaseThingHandler {
|
||||
times[1] = (short) (((BigDecimal) getConfig().get(UP_DOWN_TIME_2)).shortValue() * 10);
|
||||
times[2] = (short) (((BigDecimal) getConfig().get(UP_DOWN_TIME_3)).shortValue() * 10);
|
||||
times[3] = (short) (((BigDecimal) getConfig().get(UP_DOWN_TIME_4)).shortValue() * 10);
|
||||
|
||||
} else if (getThing().getThingTypeUID().equals(THING_TYPE_DIM)) {
|
||||
times[0] = (((BigDecimal) getConfig().get(DIM_TIME_1)).shortValue());
|
||||
times[1] = (((BigDecimal) getConfig().get(DIM_TIME_2)).shortValue());
|
||||
|
@ -137,7 +137,6 @@ public class PilightConnector implements Runnable, Closeable {
|
||||
connect();
|
||||
}
|
||||
}
|
||||
|
||||
} catch (InterruptedException e) {
|
||||
logger.debug("Interrupting thread.");
|
||||
Thread.currentThread().interrupt();
|
||||
|
@ -59,7 +59,6 @@ public class SerialAvrConnection extends StreamAvrConnection {
|
||||
.collect(Collectors.joining(", "));
|
||||
throw new IOException(
|
||||
"Serial port with name " + portName + " does not exist. Available port names: " + availablePorts);
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -123,7 +123,6 @@ public class QbusBridgeHandler extends BaseBridgeHandler {
|
||||
bridgePending("Waiting for Qbus client to come online");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -244,7 +244,6 @@ public final class QbusCommunication extends BaseThingHandler {
|
||||
try {
|
||||
while (!Thread.currentThread().isInterrupted() && ((qMessage = reader.readLine()) != null)) {
|
||||
readMessage(qMessage);
|
||||
|
||||
}
|
||||
} catch (IOException e) {
|
||||
if (!listenerStopped) {
|
||||
@ -301,7 +300,6 @@ public final class QbusCommunication extends BaseThingHandler {
|
||||
}
|
||||
if ((writer == null) || (writer.checkError())) {
|
||||
logger.warn("Error resending message");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -551,7 +549,6 @@ public final class QbusCommunication extends BaseThingHandler {
|
||||
throw new IOException("Cannot read from socket, reader not connected.");
|
||||
}
|
||||
readMessage(reader.readLine());
|
||||
|
||||
} else {
|
||||
QbusBridgeHandler handler = bridgeCallBack;
|
||||
if (handler != null) {
|
||||
@ -584,7 +581,6 @@ public final class QbusCommunication extends BaseThingHandler {
|
||||
if (handler != null) {
|
||||
handler.bridgeOnline();
|
||||
}
|
||||
|
||||
} else {
|
||||
if (handler != null) {
|
||||
handler.bridgeOffline(ThingStatusDetail.CONFIGURATION_ERROR, "No serial nr defined");
|
||||
|
@ -29,7 +29,7 @@ import org.openhab.core.types.Type;
|
||||
* RFXCOM data class for energy message.
|
||||
*
|
||||
* @author Unknown - Initial contribution
|
||||
* @author Pauli Anttila
|
||||
* @author Pauli Anttila - Migrated to OH2
|
||||
*/
|
||||
public class RFXComEnergyMessage extends RFXComBatteryDeviceMessage<RFXComEnergyMessage.SubType> {
|
||||
|
||||
|
@ -19,7 +19,7 @@ import org.openhab.core.types.Type;
|
||||
* RFXCOM data class for control message.
|
||||
*
|
||||
* @author Pauli Anttila - Initial contribution
|
||||
* @author Mike Jagdis
|
||||
* @author Mike Jagdis - Improvements
|
||||
*/
|
||||
public class RFXComInterfaceControlMessage extends RFXComBaseMessage {
|
||||
private byte[] data = new byte[14];
|
||||
|
@ -33,7 +33,7 @@ import org.openhab.core.types.UnDefType;
|
||||
* RFXCOM data class for lighting1 message. See X10, ARC, etc..
|
||||
*
|
||||
* @author Evert van Es, Cycling Engineer - Initial contribution
|
||||
* @author Pauli Anttila
|
||||
* @author Pauli Anttila - Migrated to OH2
|
||||
*/
|
||||
public class RFXComLighting1Message extends RFXComDeviceMessageImpl<RFXComLighting1Message.SubType> {
|
||||
|
||||
|
@ -41,7 +41,7 @@ import org.openhab.core.types.UnDefType;
|
||||
* RFXCOM data class for lighting5 message.
|
||||
*
|
||||
* @author Paul Hampson, Neil Renaud - Initial contribution
|
||||
* @author Pauli Anttila
|
||||
* @author Pauli Anttila - Migrated to OH2
|
||||
* @author Martin van Wingerden - added support for IT and some other subtypes
|
||||
*/
|
||||
public class RFXComLighting5Message extends RFXComDeviceMessageImpl<RFXComLighting5Message.SubType> {
|
||||
|
@ -37,7 +37,7 @@ import org.openhab.core.util.HexUtils;
|
||||
/**
|
||||
* RFXCOM data class for raw messages.
|
||||
*
|
||||
* @author James Hewitt-Thomas - New addition to the PRO RFXCom firmware
|
||||
* @author James Hewitt-Thomas - Initial contribution, new addition to the PRO RFXCom firmware
|
||||
*/
|
||||
public class RFXComRawMessage extends RFXComDeviceMessageImpl<RFXComRawMessage.SubType> {
|
||||
|
||||
|
@ -32,7 +32,7 @@ import org.openhab.core.types.Type;
|
||||
* (i.e. X10 Security, Visonic PowerCode, Meiantech, etc.)
|
||||
*
|
||||
* @author David Kalff - Initial contribution
|
||||
* @author Pauli Anttila
|
||||
* @author Pauli Anttila - Improvements
|
||||
*/
|
||||
public class RFXComSecurity1Message extends RFXComBatteryDeviceMessage<RFXComSecurity1Message.SubType> {
|
||||
|
||||
|
@ -29,7 +29,7 @@ import org.openhab.core.types.UnDefType;
|
||||
/**
|
||||
* RFXCOM data class for UV and temperature message.
|
||||
*
|
||||
* @author Damien Servant - OpenHAB1 version
|
||||
* @author Damien Servant - Initial contribution, OpenHAB1 version
|
||||
* @author Mike Jagdis - Initial contribution, OpenHAB2 version
|
||||
*/
|
||||
public class RFXComUVMessage extends RFXComBatteryDeviceMessage<RFXComUVMessage.SubType> {
|
||||
|
@ -30,7 +30,7 @@ import org.openhab.core.util.HexUtils;
|
||||
/**
|
||||
* Test for RFXCom-binding
|
||||
*
|
||||
* @author James Hewitt-Thomas - New addition to the PRO RFXCom firmware
|
||||
* @author James Hewitt-Thomas - Initial contribution, new addition to the PRO RFXCom firmware
|
||||
*/
|
||||
@NonNullByDefault
|
||||
public class RFXComRawMessageTest {
|
||||
|
@ -173,7 +173,6 @@ public abstract class SerialThingHandler extends BaseThingHandler implements Ser
|
||||
availablePorts);
|
||||
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, description);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
// initialize serial port
|
||||
@ -322,7 +321,6 @@ public abstract class SerialThingHandler extends BaseThingHandler implements Ser
|
||||
Thread.sleep(sleep);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
|
||||
}
|
||||
} catch (InterruptedIOException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
|
@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<thing:thing-descriptions bindingId="salus"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0"
|
||||
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0
|
||||
org.eclipse.smarthome.thing-description.xsd">
|
||||
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
|
||||
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
|
||||
|
||||
<bridge-type id="salus-aws-bridge">
|
||||
<label>AWS Salus Cloud</label>
|
||||
|
@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<thing:thing-descriptions bindingId="salus"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0"
|
||||
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0
|
||||
org.eclipse.smarthome.thing-description.xsd">
|
||||
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
|
||||
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
|
||||
|
||||
<bridge-type id="salus-cloud-bridge">
|
||||
<label>Salus Cloud</label>
|
||||
|
@ -84,7 +84,7 @@
|
||||
<state readOnly="true"/>
|
||||
</channel-type>
|
||||
<channel-type id="generic-input-number-channel">
|
||||
<item-type>Number:Dimensionsless</item-type>
|
||||
<item-type>Number:Dimensionless</item-type>
|
||||
<label>Generic Number Input</label>
|
||||
<description>
|
||||
This channel type represents a generic input.
|
||||
|
@ -86,7 +86,7 @@ public class SamsungTvHandler extends BaseThingHandler implements RegistryListen
|
||||
private static final String HTTP_ENDPOINT_V2 = "/api/v2/";
|
||||
|
||||
// common Samsung TV remote control ports
|
||||
private final static List<Integer> PORTS = List.of(55000, 1515, 7001, 15500);
|
||||
private static final List<Integer> PORTS = List.of(55000, 1515, 7001, 15500);
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(SamsungTvHandler.class);
|
||||
|
||||
@ -120,13 +120,13 @@ public class SamsungTvHandler extends BaseThingHandler implements RegistryListen
|
||||
@NonNullByDefault({})
|
||||
public class TVProperties {
|
||||
class Device {
|
||||
boolean FrameTVSupport;
|
||||
boolean GamePadSupport;
|
||||
boolean ImeSyncedSupport;
|
||||
String OS;
|
||||
String PowerState;
|
||||
boolean TokenAuthSupport;
|
||||
boolean VoiceSupport;
|
||||
boolean frameTVSupport;
|
||||
boolean gamePadSupport;
|
||||
boolean imeSyncedSupport;
|
||||
String oS;
|
||||
String powerState;
|
||||
boolean tokenAuthSupport;
|
||||
boolean voiceSupport;
|
||||
String countryCode;
|
||||
String description;
|
||||
String firmwareVersion;
|
||||
@ -143,22 +143,22 @@ public class SamsungTvHandler extends BaseThingHandler implements RegistryListen
|
||||
String isSupport;
|
||||
|
||||
public boolean getFrameTVSupport() {
|
||||
return Optional.ofNullable(device).map(a -> a.FrameTVSupport).orElse(false);
|
||||
return Optional.ofNullable(device).map(a -> a.frameTVSupport).orElse(false);
|
||||
}
|
||||
|
||||
public boolean getTokenAuthSupport() {
|
||||
return Optional.ofNullable(device).map(a -> a.TokenAuthSupport).orElse(false);
|
||||
return Optional.ofNullable(device).map(a -> a.tokenAuthSupport).orElse(false);
|
||||
}
|
||||
|
||||
public String getPowerState() {
|
||||
if (!getOS().isBlank()) {
|
||||
return Optional.ofNullable(device).map(a -> a.PowerState).orElse("on");
|
||||
return Optional.ofNullable(device).map(a -> a.powerState).orElse("on");
|
||||
}
|
||||
return "off";
|
||||
}
|
||||
|
||||
public String getOS() {
|
||||
return Optional.ofNullable(device).map(a -> a.OS).orElse("");
|
||||
return Optional.ofNullable(device).map(a -> a.oS).orElse("");
|
||||
}
|
||||
|
||||
public String getWifiMac() {
|
||||
@ -347,10 +347,10 @@ public class SamsungTvHandler extends BaseThingHandler implements RegistryListen
|
||||
public String fetchPowerState() {
|
||||
logger.trace("{}: fetching TV Power State", host);
|
||||
TVProperties properties = fetchTVProperties(0, 2);
|
||||
String PowerState = properties.getPowerState();
|
||||
setPowerState("on".equals(PowerState));
|
||||
logger.debug("{}: PowerState is: {}", host, PowerState);
|
||||
return PowerState;
|
||||
String powerState = properties.getPowerState();
|
||||
setPowerState("on".equals(powerState));
|
||||
logger.debug("{}: PowerState is: {}", host, powerState);
|
||||
return powerState;
|
||||
}
|
||||
|
||||
public boolean handleCommand(String channel, Command command, int ms) {
|
||||
@ -638,7 +638,6 @@ public class SamsungTvHandler extends BaseThingHandler implements RegistryListen
|
||||
* @return true if service restated or created, false otherwise
|
||||
*/
|
||||
private synchronized boolean createService(String type, String udn) {
|
||||
|
||||
Optional<SamsungTvService> service = findServiceInstance(type);
|
||||
|
||||
if (service.isPresent()) {
|
||||
|
@ -32,7 +32,6 @@ public class SensiboModelTest {
|
||||
|
||||
@Test
|
||||
public void testCaseInsensitiveMacAddress() throws IOException {
|
||||
|
||||
final PodDetailsDTO rsp = wireHelper.deSerializeResponse("/get_pod_details_response.json", PodDetailsDTO.class);
|
||||
SensiboSky sky = new SensiboSky(rsp);
|
||||
|
||||
|
@ -73,7 +73,6 @@ public class HTTPHandler {
|
||||
}
|
||||
callback.onError(Objects.requireNonNullElse(failure, "Unknown error"));
|
||||
} else {
|
||||
|
||||
callback.onResponse(Objects.requireNonNull(getContentAsString()));
|
||||
}
|
||||
}
|
||||
|
@ -73,8 +73,7 @@ public class TimeOfDayTypeConverter extends AbstractTypeConverter {
|
||||
if ("----".equals(value.getAsString())) {
|
||||
return new DateTimeType(ZonedDateTime.now(this.timeZoneProvider.getTimeZone()));
|
||||
} else {
|
||||
|
||||
if (unit.equals("h:m")) {
|
||||
if ("h:m".equals(unit)) {
|
||||
String st = value.getAsString();
|
||||
String[] parts = st.split(":");
|
||||
int h = Integer.parseInt(parts[0]);
|
||||
@ -83,7 +82,7 @@ public class TimeOfDayTypeConverter extends AbstractTypeConverter {
|
||||
Unit<Time> targetUnit = Units.MINUTE;
|
||||
return new QuantityType<>(h * 60 + m, targetUnit);
|
||||
|
||||
} else if (unit.equals("m:s")) {
|
||||
} else if ("m:s".equals(unit)) {
|
||||
String st = value.getAsString();
|
||||
String[] parts = st.split(":");
|
||||
int m = Integer.parseInt(parts[0]);
|
||||
@ -92,7 +91,7 @@ public class TimeOfDayTypeConverter extends AbstractTypeConverter {
|
||||
Unit<Time> targetUnit = Units.SECOND;
|
||||
return new QuantityType<>(m * 60 + s, targetUnit);
|
||||
|
||||
} else if (unit.equals("h")) {
|
||||
} else if ("h".equals(unit)) {
|
||||
int val = Integer.parseInt(value.getAsString());
|
||||
|
||||
Unit<Time> targetUnit = Units.HOUR;
|
||||
|
@ -129,7 +129,6 @@ public class SiemensHvacBridgeThingHandler extends BaseBridgeHandler {
|
||||
return df.format(dt);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
return "unknown";
|
||||
|
@ -253,7 +253,6 @@ public class SiemensHvacHandlerImpl extends BaseThingHandler {
|
||||
} catch (ConverterException ex) {
|
||||
logger.warn("{}, for uid: {}, please check the item type", ex.getMessage(), uid);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -336,7 +335,6 @@ public class SiemensHvacHandlerImpl extends BaseThingHandler {
|
||||
|
||||
logger.trace("Write request response: {} ", response);
|
||||
}
|
||||
|
||||
} else {
|
||||
logger.debug("Failed to get converted state from datapoint '{}'", dp);
|
||||
}
|
||||
|
@ -186,7 +186,6 @@ public class SiemensHvacMetadataDataPoint extends SiemensHvacMetadata {
|
||||
detailsResolved = true;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (desc != null) {
|
||||
|
@ -431,9 +431,7 @@ public class SiemensHvacMetadataRegistryImpl implements SiemensHvacMetadataRegis
|
||||
for (SiemensHvacMetadata child : childs) {
|
||||
generateThingsType(child, groupTypes, menu);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
tt = createThingType(device, groupTypes);
|
||||
@ -511,7 +509,6 @@ public class SiemensHvacMetadataRegistryImpl implements SiemensHvacMetadataRegis
|
||||
groupTypes.add(groupType);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -819,7 +816,6 @@ public class SiemensHvacMetadataRegistryImpl implements SiemensHvacMetadataRegis
|
||||
}
|
||||
|
||||
idx++;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -839,10 +835,7 @@ public class SiemensHvacMetadataRegistryImpl implements SiemensHvacMetadataRegis
|
||||
lcHvacConnector.resetSessionId(null, false);
|
||||
lcHvacConnector.resetSessionId(null, true);
|
||||
}
|
||||
|
||||
} catch (
|
||||
|
||||
Exception e) {
|
||||
} catch (Exception e) {
|
||||
logger.error("siemensHvac:ResolveDpt:Error during dp reading: {}", e.getLocalizedMessage());
|
||||
// Reset sessionId so we redone _auth on error
|
||||
}
|
||||
@ -933,7 +926,6 @@ public class SiemensHvacMetadataRegistryImpl implements SiemensHvacMetadataRegis
|
||||
|
||||
lcDevices.add(deviceObj);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("siemensHvac:ResolveDpt:Error during dp reading: {}", e.getLocalizedMessage());
|
||||
// Reset sessionId so we redone _auth on error
|
||||
@ -1161,14 +1153,12 @@ public class SiemensHvacMetadataRegistryImpl implements SiemensHvacMetadataRegis
|
||||
child.setDptId(dptId);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1213,7 +1203,6 @@ public class SiemensHvacMetadataRegistryImpl implements SiemensHvacMetadataRegis
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
logger.warn("Couldn't read Siemens MetaData information from file '{}'.", file.getAbsolutePath());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1238,10 +1227,8 @@ public class SiemensHvacMetadataRegistryImpl implements SiemensHvacMetadataRegis
|
||||
os.flush();
|
||||
}
|
||||
}
|
||||
|
||||
} catch (IOException ioe) {
|
||||
logger.warn("Couldn't write Siemens MetaData information to file '{}'.", file.getAbsolutePath());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -374,7 +374,6 @@ public class SiemensHvacConnectorImpl implements SiemensHvacConnector {
|
||||
"Session request auth was unsuccessful in _doAuth(), please verify login parameters");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -469,7 +468,6 @@ public class SiemensHvacConnectorImpl implements SiemensHvacConnector {
|
||||
return resultObj;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
@ -541,7 +539,6 @@ public class SiemensHvacConnectorImpl implements SiemensHvacConnector {
|
||||
} catch (SiemensHvacException ex) {
|
||||
logger.debug("error unregistring handler: {}", handler);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -228,7 +228,6 @@ public class SiemensHvacRequestListener extends BufferingResponseListener
|
||||
mayRetry);
|
||||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
logger.debug("error(5): invalid response from gateway, missing Result entry");
|
||||
hvacConnector.onError(result.getRequest(), requestHandler, ErrorSource.ErrorBridge, mayRetry);
|
||||
|
@ -132,7 +132,6 @@ public class SolarMaxHandler extends BaseThingHandler {
|
||||
State state = solarMaxData.getDataDateTime();
|
||||
logger.debug("Update channel state: {} - {}", channelId, state);
|
||||
updateState(channel.getUID(), state);
|
||||
|
||||
} else {
|
||||
// must be somthing to collect from the device, so...
|
||||
if (solarMaxData.has(SolarMaxCommandKey.valueOf(channelId))) {
|
||||
|
@ -45,14 +45,14 @@
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="co2_concentration">
|
||||
<item-type>Number:DimensionLess</item-type>
|
||||
<item-type>Number:Dimensionless</item-type>
|
||||
<label>CO2 concentration</label>
|
||||
<description>A CO2 sensor carbon dioxide concentration in ppm</description>
|
||||
<state readOnly="true" pattern="%d %unit%"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="noise">
|
||||
<item-type>Number:DimensionLess</item-type>
|
||||
<item-type>Number:Dimensionless</item-type>
|
||||
<label>Noise</label>
|
||||
<description>A noise sensor noise in decibel</description>
|
||||
<state readOnly="true" pattern="%d %unit%"/>
|
||||
|
@ -73,7 +73,6 @@ public class SonyProjectorDiscoveryParticipant implements SddpDiscoveryParticipa
|
||||
if (device.manufacturer.toUpperCase(Locale.ENGLISH).contains(SONY)
|
||||
&& device.type.toUpperCase(Locale.ENGLISH).contains(TYPE_PROJECTOR) && !device.macAddress.isBlank()
|
||||
&& !device.ipAddress.isBlank()) {
|
||||
|
||||
logger.debug("Sony projector with mac {} found at {}", device.macAddress, device.ipAddress);
|
||||
return new ThingUID(THING_TYPE_ETHERNET, device.macAddress);
|
||||
}
|
||||
|
@ -39,7 +39,6 @@ public class SynopLand extends Synop {
|
||||
}
|
||||
} catch (NumberFormatException ignore) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,6 @@ public enum WindDirections {
|
||||
* Returns the wind direction based on degree.
|
||||
*/
|
||||
public static WindDirections getWindDirection(int degree) {
|
||||
|
||||
double b = Math.floor((degree + (STEP / 2.0)) / STEP);
|
||||
return values()[(int) (b % values().length)];
|
||||
}
|
||||
|
@ -130,7 +130,6 @@ public class TACmiCoEBridgeHandler extends BaseBridgeHandler {
|
||||
}
|
||||
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
|
||||
"Error processing data: " + e.getMessage());
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
// we catch runtime exceptions here to prevent the receiving thread to stop accidentally if
|
||||
// something like an IllegalStateException or NumberFormatExceptions are thrown. This indicates a
|
||||
|
@ -19,7 +19,7 @@ import org.openhab.binding.tacmi.internal.TACmiMeasureType;
|
||||
* This class handles analog values as used in the analog message.
|
||||
*
|
||||
* @author Timo Wendt - Initial contribution
|
||||
* @author Wolfgang Klimt
|
||||
* @author Wolfgang Klimt - Improvements
|
||||
* @author Christian Niessner - Ported to OpenHAB2
|
||||
*/
|
||||
@NonNullByDefault
|
||||
|
@ -61,7 +61,6 @@ public class HomeApi {
|
||||
}
|
||||
|
||||
public void deleteZoneOverlay(Long homeId, Long zoneId) throws IOException, ApiException {
|
||||
|
||||
// verify the required parameter 'homeId' is set
|
||||
if (homeId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'homeId' when calling deleteZoneOverlay");
|
||||
@ -103,7 +102,6 @@ public class HomeApi {
|
||||
}
|
||||
|
||||
public HomeState homeState(Long homeId) throws IOException, ApiException {
|
||||
|
||||
// verify the required parameter 'homeId' is set
|
||||
if (homeId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'homeId' when calling homeState");
|
||||
@ -142,7 +140,6 @@ public class HomeApi {
|
||||
}
|
||||
|
||||
public List<MobileDevice> listMobileDevices(Long homeId) throws IOException, ApiException {
|
||||
|
||||
// verify the required parameter 'homeId' is set
|
||||
if (homeId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'homeId' when calling listMobileDevices");
|
||||
@ -181,7 +178,6 @@ public class HomeApi {
|
||||
}
|
||||
|
||||
public List<Zone> listZones(Long homeId) throws IOException, ApiException {
|
||||
|
||||
// verify the required parameter 'homeId' is set
|
||||
if (homeId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'homeId' when calling listZones");
|
||||
@ -220,7 +216,6 @@ public class HomeApi {
|
||||
}
|
||||
|
||||
public HomeInfo showHome(Long homeId) throws IOException, ApiException {
|
||||
|
||||
// verify the required parameter 'homeId' is set
|
||||
if (homeId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'homeId' when calling showHome");
|
||||
@ -259,7 +254,6 @@ public class HomeApi {
|
||||
}
|
||||
|
||||
public User showUser() throws IOException, ApiException {
|
||||
|
||||
startHttpClient(CLIENT);
|
||||
|
||||
// create path and map variables
|
||||
@ -293,7 +287,6 @@ public class HomeApi {
|
||||
}
|
||||
|
||||
public GenericZoneCapabilities showZoneCapabilities(Long homeId, Long zoneId) throws IOException, ApiException {
|
||||
|
||||
// verify the required parameter 'homeId' is set
|
||||
if (homeId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'homeId' when calling showZoneCapabilities");
|
||||
@ -339,7 +332,6 @@ public class HomeApi {
|
||||
}
|
||||
|
||||
public OverlayTemplate showZoneDefaultOverlay(Long homeId, Long zoneId) throws IOException, ApiException {
|
||||
|
||||
// verify the required parameter 'homeId' is set
|
||||
if (homeId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'homeId' when calling showZoneDefaultOverlay");
|
||||
@ -385,7 +377,6 @@ public class HomeApi {
|
||||
}
|
||||
|
||||
public Zone showZoneDetails(Long homeId, Long zoneId) throws IOException, ApiException {
|
||||
|
||||
// verify the required parameter 'homeId' is set
|
||||
if (homeId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'homeId' when calling showZoneDetails");
|
||||
@ -431,7 +422,6 @@ public class HomeApi {
|
||||
}
|
||||
|
||||
public Overlay showZoneOverlay(Long homeId, Long zoneId) throws IOException, ApiException {
|
||||
|
||||
// verify the required parameter 'homeId' is set
|
||||
if (homeId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'homeId' when calling showZoneOverlay");
|
||||
@ -477,7 +467,6 @@ public class HomeApi {
|
||||
}
|
||||
|
||||
public ZoneState showZoneState(Long homeId, Long zoneId) throws IOException, ApiException {
|
||||
|
||||
// verify the required parameter 'homeId' is set
|
||||
if (homeId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'homeId' when calling showZoneState");
|
||||
@ -522,7 +511,6 @@ public class HomeApi {
|
||||
}
|
||||
|
||||
public void updatePresenceLock(Long homeId, HomePresence json) throws IOException, ApiException {
|
||||
|
||||
// verify the required parameter 'homeId' is set
|
||||
if (homeId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'homeId' when calling updatePresenceLock");
|
||||
@ -565,7 +553,6 @@ public class HomeApi {
|
||||
}
|
||||
|
||||
public Overlay updateZoneOverlay(Long homeId, Long zoneId, Overlay json) throws IOException, ApiException {
|
||||
|
||||
// verify the required parameter 'homeId' is set
|
||||
if (homeId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'homeId' when calling updateZoneOverlay");
|
||||
|
@ -105,7 +105,7 @@ Channel availability depends on the electricity connection (single or three-phas
|
||||
| bbrhpjw | `Number:Energy` | Total consumed energy at high rate pricing on white days | All | Tempo |
|
||||
| bbrhcjr | `Number:Energy` | Total consumed energy at low rate pricing on red days | All | Tempo |
|
||||
| bbrhpjr | `Number:Energy` | Total consumed energy at high rate pricing on red days | All | Tempo |
|
||||
| pejp | `Number:Duration` | Prior notice to EJP start | All | EJP |
|
||||
| pejp | `Number:Time` | Prior notice to EJP start | All | EJP |
|
||||
| demain | `String` | Following day color | All | Tempo |
|
||||
|
||||
### Standard TIC mode
|
||||
|
@ -93,7 +93,6 @@ public class VeluxBinding extends VeluxBridgeConfiguration {
|
||||
this.isBulkRetrievalEnabled = uncheckedConfiguration.isBulkRetrievalEnabled;
|
||||
this.isSequentialEnforced = uncheckedConfiguration.isSequentialEnforced;
|
||||
this.isProtocolTraceEnabled = uncheckedConfiguration.isProtocolTraceEnabled;
|
||||
|
||||
}
|
||||
logger.trace("VeluxBinding(constructor) done.");
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ public class VigiCruesHandler extends BaseThingHandler {
|
||||
try {
|
||||
HubEauResponse stationDetails = apiHandler.discoverStations(config.id);
|
||||
List<StationData> stations = stationDetails.stations;
|
||||
if (stations != null && stations.size() > 0) {
|
||||
if (stations != null && !stations.isEmpty()) {
|
||||
stationDetails.stations.stream().findFirst().ifPresent(station -> {
|
||||
PointType stationLocation = new PointType(
|
||||
String.format(Locale.US, "%f,%f", station.latitudeStation, station.longitudeStation));
|
||||
|
@ -67,7 +67,7 @@ public class DescriptionLoader {
|
||||
}
|
||||
var body = response.getContentAsString();
|
||||
var description = gson.fromJson(body, WebThingDescription.class);
|
||||
if ((description != null) && (description.properties != null) && (description.properties.size() > 0)) {
|
||||
if ((description != null) && (description.properties != null) && !description.properties.isEmpty()) {
|
||||
if ((description.contextKeyword == null) || description.contextKeyword.trim().length() == 0) {
|
||||
description.contextKeyword = "https://webthings.io/schemas";
|
||||
}
|
||||
|
@ -30,8 +30,8 @@ import org.slf4j.LoggerFactory;
|
||||
* Abstract WiFi LED driver.
|
||||
*
|
||||
* @author Osman Basha - Initial contribution
|
||||
* @author Stefan Endrullis
|
||||
* @author Ries van Twisk
|
||||
* @author Stefan Endrullis - Improvements
|
||||
* @author Ries van Twisk - Improvements
|
||||
*/
|
||||
public abstract class AbstractWiFiLEDDriver {
|
||||
|
||||
|
@ -28,7 +28,7 @@ import org.openhab.core.library.types.StringType;
|
||||
* It's used for sending color or program settings and also extracting the data out of the received telegrams.
|
||||
*
|
||||
* @author Osman Basha - Initial contribution
|
||||
* @author Stefan Endrullis
|
||||
* @author Stefan Endrullis - Improvements
|
||||
* @author Ries van Twisk - Prevent flashes during classic driver color + white updates
|
||||
*/
|
||||
public class ClassicWiFiLEDDriver extends AbstractWiFiLEDDriver {
|
||||
|
@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
|
||||
* It utilizes color fading when changing colors or turning the light on of off.
|
||||
*
|
||||
* @author Stefan Endrullis - Initial contribution
|
||||
* @author Ries van Twisk
|
||||
* @author Ries van Twisk - Improvements
|
||||
*/
|
||||
public class FadingWiFiLEDDriver extends AbstractWiFiLEDDriver {
|
||||
|
||||
|
@ -40,7 +40,7 @@ import org.slf4j.LoggerFactory;
|
||||
* sent to one of the channels.
|
||||
*
|
||||
* @author Osman Basha - Initial contribution
|
||||
* @author Ries van Twisk
|
||||
* @author Ries van Twisk - Improvements
|
||||
*/
|
||||
public class WiFiLEDHandler extends BaseThingHandler {
|
||||
|
||||
|
@ -20,7 +20,7 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* Test for LEDStateDTO
|
||||
*
|
||||
* @author Ries van Twisk - Prevent flashes during classic driver color + white updates
|
||||
* @author Ries van Twisk - Initial contribution, prevent flashes during classic driver color + white updates
|
||||
*/
|
||||
public class LEDStateDTOTest {
|
||||
|
||||
|
@ -113,7 +113,6 @@ public class DeviceInformationXML implements DeviceInformation {
|
||||
|
||||
XMLConstants.FEATURE_BY_YNC_TAG
|
||||
.forEach((name, feature) -> checkFeature(featureNode, name, feature, state.features));
|
||||
|
||||
} else {
|
||||
// on older models (RX-V3900) the Feature_Existence element does not exist
|
||||
|
||||
|
@ -41,7 +41,8 @@ import org.w3c.dom.Node;
|
||||
* No state will be saved in here, but in {@link DabBandState}, {@link PresetInfoState} and {@link PlayInfoState}
|
||||
* instead.
|
||||
*
|
||||
* @author Tomasz Maruszak - [yamaha] Tuner band selection and preset feature for dual band models (RX-S601D)
|
||||
* @author Tomasz Maruszak - Initial contribution, [yamaha] Tuner band selection and preset feature for dual band models
|
||||
* (RX-S601D)
|
||||
*/
|
||||
public class InputWithTunerDABControlXML extends AbstractInputControlXML
|
||||
implements InputWithTunerBandControl, InputWithPresetControl {
|
||||
|
@ -93,7 +93,6 @@ public class XMLConnection extends AbstractConnection {
|
||||
}
|
||||
|
||||
return responseConsumer.apply(connection);
|
||||
|
||||
} finally {
|
||||
if (connection != null) {
|
||||
connection.disconnect();
|
||||
|
@ -39,11 +39,11 @@ import org.w3c.dom.Node;
|
||||
* The zone protocol class is used to control one zone of a Yamaha receiver with HTTP/xml.
|
||||
* No state will be saved in here, but in {@link ZoneControlState} instead.
|
||||
*
|
||||
* @author Tomasz Maruszak - Initial contribution, refactoring, input mapping fix, added
|
||||
* Straight surround, volume DB fix and config improvement.
|
||||
* @author David Gräff - Refactored
|
||||
* @author Eric Thill
|
||||
* @author Ben Jones
|
||||
* @author Tomasz Maruszak - Refactoring, input mapping fix, added Straight surround, volume DB fix and config
|
||||
* improvement.
|
||||
* @author Eric Thill - Unknown
|
||||
* @author Ben Jones - Unknown
|
||||
*/
|
||||
public class ZoneControlXML implements ZoneControl {
|
||||
|
||||
@ -157,7 +157,6 @@ public class ZoneControlXML implements ZoneControl {
|
||||
"Surr/Pgm_Sel/Straight");
|
||||
logger.debug("Zone {} - adjusting command to: {}", getZone(), surroundSelStraight);
|
||||
}
|
||||
|
||||
} catch (ReceivedMessageParseException | IOException e) {
|
||||
logger.debug("Could not perform feature detection for RX-V3900");
|
||||
}
|
||||
|
@ -17,7 +17,8 @@ import static org.openhab.binding.yamahareceiver.internal.YamahaReceiverBindingC
|
||||
/**
|
||||
* The band state for DAB tuners.
|
||||
*
|
||||
* @author Tomasz Maruszak - [yamaha] Tuner band selection and preset feature for dual band models (RX-S601D)
|
||||
* @author Tomasz Maruszak - Initial contribution, [yamaha] Tuner band selection and preset feature for dual band models
|
||||
* (RX-S601D)
|
||||
*/
|
||||
public class DabBandState implements Invalidateable {
|
||||
|
||||
|
@ -15,7 +15,8 @@ package org.openhab.binding.yamahareceiver.internal.state;
|
||||
/**
|
||||
* Listener for changes to {@link DabBandState}
|
||||
*
|
||||
* @author Tomasz Maruszak - [yamaha] Tuner band selection and preset feature for dual band models (RX-S601D)
|
||||
* @author Tomasz Maruszak - Initial contribution, [yamaha] Tuner band selection and preset feature for dual band models
|
||||
* (RX-S601D)
|
||||
*/
|
||||
public interface DabBandStateListener {
|
||||
void dabBandUpdated(DabBandState msg);
|
||||
|
@ -15,7 +15,8 @@ package org.openhab.binding.yamahareceiver.internal.state;
|
||||
/**
|
||||
* Represent object whose state can be invalidated.
|
||||
*
|
||||
* @author Tomasz Maruszak - [yamaha] Tuner band selection and preset feature for dual band models (RX-S601D)
|
||||
* @author Tomasz Maruszak - Initial contribution, [yamaha] Tuner band selection and preset feature for dual band models
|
||||
* (RX-S601D)
|
||||
*/
|
||||
public interface Invalidateable {
|
||||
|
||||
|
@ -55,7 +55,7 @@ import org.slf4j.LoggerFactory;
|
||||
@NonNullByDefault
|
||||
public class StateFilterProfile implements StateProfile {
|
||||
|
||||
private final static String OPERATOR_NAME_PATTERN = Stream.of(StateCondition.ComparisonType.values())
|
||||
private static final String OPERATOR_NAME_PATTERN = Stream.of(StateCondition.ComparisonType.values())
|
||||
.map(StateCondition.ComparisonType::name)
|
||||
// We want to match the longest operator first, e.g. `GTE` before `GT`
|
||||
.sorted(Comparator.comparingInt(String::length).reversed())
|
||||
@ -63,13 +63,13 @@ public class StateFilterProfile implements StateProfile {
|
||||
// so we can have conditions against input data without needing a leading space, e.g. `GTE 0`
|
||||
.collect(Collectors.joining("|", "(?:(?<=\\S)\\s+|^\\s*)(?:", ")\\s"));
|
||||
|
||||
private final static String OPERATOR_SYMBOL_PATTERN = Stream.of(StateCondition.ComparisonType.values())
|
||||
private static final String OPERATOR_SYMBOL_PATTERN = Stream.of(StateCondition.ComparisonType.values())
|
||||
.map(StateCondition.ComparisonType::symbol)
|
||||
// We want to match the longest operator first, e.g. `<=` before `<`
|
||||
.sorted(Comparator.comparingInt(String::length).reversed()) //
|
||||
.collect(Collectors.joining("|", "(?:", ")"));
|
||||
|
||||
private final static Pattern EXPRESSION_PATTERN = Pattern.compile(
|
||||
private static final Pattern EXPRESSION_PATTERN = Pattern.compile(
|
||||
// - Without the non-greedy operator in the first capture group,
|
||||
// it will match `Item<` when encountering `Item<>X` condition
|
||||
// - Symbols may be more prevalently used, so check them first
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user