import org.openhab.binding.digitalstrom.internal.lib.structure.devices.Circuit;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.Device;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.GeneralDeviceInformation;
-import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.OutputModeEnum;
import org.openhab.binding.digitalstrom.internal.providers.DsDeviceThingTypeProvider;
import org.openhab.core.config.discovery.AbstractDiscoveryService;
import org.openhab.core.config.discovery.DiscoveryResult;
import org.openhab.core.config.discovery.DiscoveryResultBuilder;
-import org.openhab.core.thing.Thing;
import org.openhab.core.thing.ThingTypeUID;
import org.openhab.core.thing.ThingUID;
import org.slf4j.Logger;
import org.openhab.core.config.discovery.AbstractDiscoveryService;
import org.openhab.core.config.discovery.DiscoveryService;
import org.openhab.core.thing.ThingTypeUID;
-import org.openhab.core.thing.type.ThingType;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import org.slf4j.Logger;
import java.util.Map;
import org.openhab.binding.digitalstrom.internal.handler.BridgeHandler;
-import org.openhab.binding.digitalstrom.internal.handler.SceneHandler;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.ApplicationGroup;
import org.openhab.binding.digitalstrom.internal.lib.structure.scene.InternalScene;
import org.openhab.binding.digitalstrom.internal.lib.structure.scene.constants.SceneEnum;
import org.openhab.binding.digitalstrom.internal.DigitalSTROMBindingConstants;
import org.openhab.binding.digitalstrom.internal.handler.BridgeHandler;
-import org.openhab.binding.digitalstrom.internal.handler.ZoneTemperatureControlHandler;
import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.TemperatureControlStatus;
import org.openhab.core.config.discovery.AbstractDiscoveryService;
import org.openhab.core.config.discovery.DiscoveryResult;
* {@link #ZoneTemperatureControlDiscoveryService(BridgeHandler, ThingTypeUID)} as {@link ThingTypeUID}. The supported
* {@link ThingTypeUID} can be found at {@link ZoneTemperatureControlHandler#SUPPORTED_THING_TYPES}
*
- * @author Michael Ochel
- * @author Matthias Siegele
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public class ZoneTemperatureControlDiscoveryService extends AbstractDiscoveryService {
import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.TemperatureControlStatus;
import org.openhab.binding.digitalstrom.internal.lib.listener.TemperatureControlStatusListener;
import org.openhab.binding.digitalstrom.internal.lib.manager.StructureManager;
-import org.openhab.binding.digitalstrom.internal.lib.manager.impl.TemperatureControlManager;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.ApplicationGroup;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.OutputChannelEnum;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.OutputModeEnum;
* The {@link TemperatureControlSensorTransmitter} can be implement by subclasses to implement a
* transmitter which can be used to push the target temperature or control value to a digitalSTROM zone.
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public interface TemperatureControlSensorTransmitter {
* <br>
* To handle the {@link EventItem} the method {@link #handleEvent(EventItem)} has to be implemented.
*
- * @author Michael Ochel
- * @author Matthias Siegele
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public interface EventHandler {
/**
* The {@link EventNames} contains all needed event names to subscribe at the digitalSTROM server.
*
- * @author Michael Ochel
- * @author Matthias Siegele
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public class EventNames {
/**
* The {@link EventResponseEnum} contains digitalSTROM-Event properties of the events at {@link EventNames}.
*
- * @author Michael Ochel
- * @author Mathias Siegele
+ * @author Michael Ochel - Initial contribution
+ * @author Mathias Siegele - Initial contribution
*/
public enum EventResponseEnum {
/**
* The {@link Event} represents a digitalSTROM-Event.
*
- * @author Alexander Betker
+ * @author Alexander Betker - Initial contribution
*/
public interface Event {
/**
* The {@link EventItem} represents an event item of a digitalSTROM-Event.
*
- * @author Alexander Betker
+ * @author Alexander Betker - Initial contribution
* @author Michael Ochel - add getSource()
* @author Matthias Siegele - add getSource()
*/
/**
* The {@link EventItemImpl} is the implementation of the {@link EventItem}.
*
- * @author Michael Ochel
- * @author Mathias Siegele
+ * @author Michael Ochel - Initial contribution
+ * @author Mathias Siegele - Initial contribution
*/
public class EventItemImpl implements EventItem {
/**
* The {@link JSONEventImpl} is the implementation of the {@link Event}.
*
- * @author Alexander Betker
+ * @author Alexander Betker - Initial contribution
*/
public class JSONEventImpl implements Event {
* The {@link SystemStateChangeListener} can be implemented to get informed by digitalSTROM system state changes. It
* has to be registered by supported classes, e.g. the {@link TemperatureControlManager} or self implemented classes.
*
- * @author Michael Ochel
- * @author Matthias Siegele
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public interface SystemStateChangeListener {
* <br>
* It also can be implemented as discovery, than the id have to be {@link #DISCOVERY}.
*
- * @author Michael Ochel
- * @author Matthias Siegele
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*
*/
public interface TemperatureControlStatusListener {
* Query to get all enabled application tokens. Can be executed with {@link DsAPI#query(String, String)} or
* {@link DsAPI#query2(String, String)}.
*/
- public final String QUERY_GET_ENABLED_APPLICATION_TOKENS = "/system/security/applicationTokens/enabled/*(*)";
+ public static final String QUERY_GET_ENABLED_APPLICATION_TOKENS = "/system/security/applicationTokens/enabled/*(*)";
private final Logger logger = LoggerFactory.getLogger(ConnectionManagerImpl.class);
private Config config;
/**
* Check and updates the {@link Device} structure, configurations and status.
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
private class PollingRunnable implements Runnable {
private boolean devicesLoaded = false;
import org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager;
import org.openhab.binding.digitalstrom.internal.lib.manager.StructureManager;
-import org.openhab.binding.digitalstrom.internal.lib.serverconnection.DsAPI;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.AbstractGeneralDeviceInformations;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.Circuit;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.Device;
* {@link #GET_HEATING_WATER_SYSTEM_STATE_PATH} to get the current heating water system state through
* {@link DsAPI#propertyTreeGetString(String, String)}.
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public class TemperatureControlManager implements EventHandler, TemperatureControlSensorTransmitter {
- private final List<String> SUPPORTED_EVENTS = Arrays.asList(EventNames.HEATING_CONTROL_OPERATION_MODE);
+ private static final List<String> SUPPORTED_EVENTS = Arrays.asList(EventNames.HEATING_CONTROL_OPERATION_MODE);
private final Logger logger = LoggerFactory.getLogger(TemperatureControlManager.class);
Integer zoneID = Integer
.parseInt(eventItem.getSource().getOrDefault(EventResponseEnum.ZONEID, ""));
if (zoneTemperationControlListenerMap.get(zoneID) != null) {
-
Float newValue = Float.parseFloat(
eventItem.getProperties().getOrDefault(EventResponseEnum.SENSOR_VALUE_FLOAT, ""));
if (!isEcho(zoneID, SensorEnum.ROOM_TEMPERATURE_CONTROL_VARIABLE, newValue)) {
import java.util.List;
import java.util.Map;
-import org.openhab.binding.digitalstrom.internal.lib.climate.constants.ControlModes;
-import org.openhab.binding.digitalstrom.internal.lib.climate.constants.OperationModes;
import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.BaseSensorValues;
import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.AssignedSensors;
import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.SensorValues;
* digitalSTROM-API based on dSS-Version higher then 1.14.5.
* digitalSTROM documentation can be found at http://developer.digitalstrom.org/Architecture/v1.1/dss-json.pdf
*
- * @author Alexander Betker - initial contributer
+ * @author Alexander Betker - Initial contribution
*
* @author Michael Ochel - add missing java-doc, update digitalSTROM-JSON-API as far as possible to the pdf version from
* June 19, 2014 and add checkConnection method and ALL_METERS constant
/**
* The {@link JSONApiResponseKeysEnum} contains digitalSTROM-JSON response keys.
*
- * @author Alexander Betker - initial contributer
+ * @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
*/
/**
* The {@link DsAPIImpl} is the implementation of the {@link DsAPI}.
*
- * @author Alexander Betker - initial contributer
- * @author Alex Maier - initial contributer
+ * @author Alexander Betker - Initial contribution
+ * @author Alex Maier - Initial contribution
* @author Michael Ochel - implements new methods, API updates and change SimpleJSON to GSON, add helper methods and
* requests building with constants to {@link SimpleRequestBuilder}
* @author Matthias Siegele - implements new methods, API updates and change SimpleJSON to GSON, add helper methods and
@Override
public DeviceConfig getDeviceConfig(String token, DSID dSID, String dSUID, String name,
- DeviceParameterClassEnum class_, Integer index) {
- if (checkRequiredDevice(dSID, dSUID, name) && class_ != null
+ DeviceParameterClassEnum classEnum, Integer index) {
+ if (checkRequiredDevice(dSID, dSUID, name) && classEnum != null
&& SimpleRequestBuilder.objectToString(index) != null) {
String response = transport.execute(SimpleRequestBuilder.buildNewJsonRequest(ClassKeys.DEVICE)
.addFunction(FunctionKeys.GET_CONFIG).addDefaultDeviceParameter(token, dSID, dSUID, name)
- .addParameter(ParameterKeys.CLASS, class_.getClassIndex().toString())
+ .addParameter(ParameterKeys.CLASS, classEnum.getClassIndex().toString())
.addParameter(ParameterKeys.INDEX, SimpleRequestBuilder.objectToString(index))
.buildRequestString());
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
-import org.apache.commons.lang3.StringUtils;
import org.openhab.binding.digitalstrom.internal.lib.config.Config;
import org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager;
import org.openhab.binding.digitalstrom.internal.lib.serverconnection.HttpTransport;
}
private boolean checkNeededSessionToken(String request) {
- String functionName = StringUtils.substringAfterLast(StringUtils.substringBefore(request, "?"), "/");
+ String requestFirstPart = request.substring(0, request.indexOf("?"));
+ String functionName = requestFirstPart.substring(requestFirstPart.lastIndexOf("/") + 1);
return !DsAPIImpl.METHODS_MUST_NOT_BE_LOGGED_IN.contains(functionName);
}
correctedRequest = correctedRequest + "?" + ParameterKeys.TOKEN + "=" + sessionToken;
}
} else {
- correctedRequest = StringUtils.replaceOnce(correctedRequest, StringUtils.substringBefore(
- StringUtils.substringAfter(correctedRequest, ParameterKeys.TOKEN + "="), "&"), sessionToken);
-
+ String strippedRequest = correctedRequest
+ .substring(correctedRequest.indexOf(ParameterKeys.TOKEN + "=") + ParameterKeys.TOKEN.length() + 1);
+ strippedRequest = strippedRequest.substring(0, strippedRequest.lastIndexOf("&"));
+ correctedRequest = correctedRequest.replaceFirst(strippedRequest, sessionToken);
}
return correctedRequest;
}
* <span style="padding-left:14em">{@link #buildRequestString()};<br>
* </span></i>
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public class SimpleRequestBuilder {
/**
* The {@link ClassKeys} contains digitalSTROM-JSON class keys.
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public class ClassKeys {
/**
* The {@link ExeptionConstants} contains the {@link SimpleRequestBuilder} exception strings.
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public class ExeptionConstants {
public static final String NO_CLASS_ADDED = "No class added! Please add a class first!";
/**
* The {@link FunctionKeys} contains digitalSTROM-JSON function keys.
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public class FunctionKeys {
/**
* The {@link InterfaceKeys} contains digitalSTROM-JSON interface keys.
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public class InterfaceKeys {
public static final String JSON = "json";
/**
* The {@link ParameterKeys} contains digitalSTROM-JSON parameter keys.
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public class ParameterKeys {
public static final String TOKEN = "token";
/**
* The {@link Apartment} represents a digitalSTROM-Apartment.
*
- * @author Alexander Betker - initial contributer
+ * @author Alexander Betker - Initial contribution
* @author Michael Ochel - add java-doc
* @author Matthias Siegele - add java-doc
*/
* The {@link DetailedGroupInfo} represents a digitalSTROM-Group with a list of all dSUID's of the included
* digitalSTROM-Devices.
*
- * @author Alexander Betker - initial contributer
+ * @author Alexander Betker - Initial contribution
* @author Michael Ochel - add java-doc
* @author Matthias Siegele - add java-doc
*/
/**
* The {@link Group} represents a digitalSTROM-Group.
*
- * @author Alexander Betker - initial contributer
+ * @author Alexander Betker - Initial contribution
* @author Michael Ochel - add java-doc
* @author Matthias Siegele - add java-doc
*/
/**
* The {@link Zone} represents a digitalSTROM-Zone.
*
- * @author Alexander Betker - initial contributer
+ * @author Alexander Betker - Initial contribution
* @author Michael Ochel - add java-doc
* @author Matthias Siegele - add java-doc
*/
* can be implement by subclasses which contains the same device informations like dSID and/or mechanismen like the
* {@link DeviceStatusListener}.
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public abstract class AbstractGeneralDeviceInformations implements GeneralDeviceInformation {
* {@link DeviceStatusListener} can be registered. For that and to get the general device informations like the dSID the
* {@link Circuit} implements the {@link GeneralDeviceInformations} interface.
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public interface Circuit extends GeneralDeviceInformation {
import java.util.Map;
import org.openhab.binding.digitalstrom.internal.lib.config.Config;
-import org.openhab.binding.digitalstrom.internal.lib.event.constants.EventNames;
import org.openhab.binding.digitalstrom.internal.lib.event.types.EventItem;
-import org.openhab.binding.digitalstrom.internal.lib.sensorjobexecutor.sensorjob.impl.DeviceConsumptionSensorJob;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.DeviceSceneSpec;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.DeviceStateUpdate;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.ApplicationGroup;
* identical for all device types. It also contains the methods to implement the mechanism of the
* {@link DeviceStatusListener}.
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public interface GeneralDeviceInformation {
/**
* The {@link DeviceConfig} saves device configurations.
*
- * @author Alexander Betker - initial contributer
+ * @author Alexander Betker - Initial contribution
* @author Michael Ochel - add missing java-doc
* @author Matthias Siegele - add missing java-doc
*/
/**
* The {@link DeviceSceneSpec} saves a digitalSTROM-Device scene mode.
*
- * @author Alexander Betker - initial contributer
+ * @author Alexander Betker - Initial contribution
* @author Michael Ochel - add missing java-doc
* @author Matthias Siegele - add missing java-doc
*/
/**
* This enum contains all binary inputs with they id. <br>
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public enum DeviceBinarayInputEnum {
/**
* The {@link DeviceParameterClassEnum} lists all digitalSTROM-device parameter classes.
*
- * @author Alexander Betker - initial contributer
+ * @author Alexander Betker - Initial contribution
* @version digitalSTROM-API 1.14.5
*/
public enum DeviceParameterClassEnum {
/**
* The {@link MeteringTypeEnum} lists all available digitalSTROM metering types.
*
- * @author Alexander Betker - initial contributer
+ * @author Alexander Betker - Initial contribution
* @author Michael Ochel - add MeteringUnitEnum list
* @author Matthias Siegele - add MeteringUnitEnum list
*/
/**
* The {@link MeteringUnitsEnum} lists all available digitalSTROM metering units.
*
- * @author Alexander Betker - initial contributer
+ * @author Alexander Betker - Initial contribution
* @author Michael Ochel - remove W, because it does not exist any more
* @author Matthias Siegele - remove W, because it does not exist any more
*/
/**
* The {@link DSID} represents the digitalSTROM-Device identifier.
*
- * @author Alexander Betker - initial contributor
+ * @author Alexander Betker - Initial contribution
* @author Alexander Friese - simplified constructor
*/
public class DSID {
private final String dsid;
- private final String DEFAULT_DSID = "3504175fe000000000000001";
- private final String PRE = "3504175fe0000000";
- private final String ALL = "ALL";
+ private static final String DEFAULT_DSID = "3504175fe000000000000001";
+ private static final String PRE = "3504175fe0000000";
+ private static final String ALL = "ALL";
/**
* Creates a new {@link DSID}.
if (trimmedDsid.length() == 24) {
this.dsid = trimmedDsid;
} else if (trimmedDsid.length() == 8) {
- this.dsid = this.PRE + trimmedDsid;
+ this.dsid = PRE + trimmedDsid;
} else if (trimmedDsid.toUpperCase().equals(ALL)) {
this.dsid = ALL;
} else {
/**
* The {@link DSUID} represents the digitalSTROM-Device unique identifier.
*
- * @author Alexander Friese - initial contributor
+ * @author Alexander Friese - Initial contribution
*/
public class DSUID {
private final String dsuid;
- private final String DEFAULT_DSUID = "3504175fe0000000000000000000000001";
+ private static final String DEFAULT_DSUID = "3504175fe0000000000000000000000001";
/**
* Creates a new {@link DSUID}.
* The {@link DeviceBinaryInput} contains all information of a device binary input, e.g. binary input type id (see
* {@link DeviceBinarayInputEnum}, state and so on.
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*
*/
public class DeviceBinaryInput {
* and
* timestamp of the last sensor update.
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public class DeviceSensorValue {
/**
* The {@link JSONDeviceConfigImpl} is the implementation of the {@link DeviceConfig}.
*
- * @author Alexander Betker - initial contributer
+ * @author Alexander Betker - Initial contribution
* @author Michael Ochel - change from SimpleJSON to GSON
* @author Matthias Siegele - change from SimpleJSON to GSON
*/
public class JSONDeviceConfigImpl implements DeviceConfig {
- private int class_ = -1;
+ private int clazz = -1;
private int index = -1;
private int value = -1;
*/
public JSONDeviceConfigImpl(JsonObject object) {
if (object.get(JSONApiResponseKeysEnum.CLASS.getKey()) != null) {
- class_ = object.get(JSONApiResponseKeysEnum.CLASS.getKey()).getAsInt();
+ clazz = object.get(JSONApiResponseKeysEnum.CLASS.getKey()).getAsInt();
}
if (object.get(JSONApiResponseKeysEnum.INDEX.getKey()) != null) {
index = object.get(JSONApiResponseKeysEnum.INDEX.getKey()).getAsInt();
@Override
public int getConfigurationClass() {
- return class_;
+ return clazz;
}
@Override
@Override
public String toString() {
- return "class: " + this.class_ + ", " + "index: " + this.index + ", " + "value: " + this.value;
+ return "class: " + this.clazz + ", " + "index: " + this.index + ", " + "value: " + this.value;
}
}
/**
* The {@link CircuitImpl} is the implementation of the {@link Circuit} and represent a digitalSTROM circuit.
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public class CircuitImpl extends AbstractGeneralDeviceInformations implements Circuit {
groupIdInter = null;
}
if (groupID != null) {
-
if (ApplicationGroup.Color.YELLOW
.equals(ApplicationGroup.getGroup(groupID).getColor())) {
discoverScene(SceneEnum.AUTO_OFF.getSceneNumber(), groupID);
/**
* The {@link SceneEnum} lists all available scenes of digitalSTROM.
*
- * @author Alexander Betker - initial contributer
+ * @author Alexander Betker - Initial contribution
* @version digitalSTROM-API 1.14.5
*
* @author Michael Ochel - add new scenes and missing java-doc
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.binding.digitalstrom.internal.lib.serverconnection.constants.JSONApiResponseKeysEnum;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.OutputChannelEnum;
-import org.openhab.binding.digitalstrom.internal.lib.structure.devices.impl.DeviceImpl;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
* digitalSTROM-Bindings. So this class can be implement e.g. by provider implementations like the
* {@link org.openhab.core.thing.type.ChannelTypeProvider}.
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public abstract class BaseDsI18n {
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.OutputModeEnum;
import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.SensorEnum;
import org.openhab.core.i18n.TranslationProvider;
-import org.openhab.core.thing.type.ChannelGroupTypeUID;
import org.openhab.core.thing.type.ChannelType;
import org.openhab.core.thing.type.ChannelTypeBuilder;
import org.openhab.core.thing.type.ChannelTypeProvider;
// sensor-events and cached values are
// shown in °C so we will use this unit for temperature sensors
String unitShortCut = sensorType.getUnitShortcut();
- if (unitShortCut.equals("%")) {
+ if ("%".equals(unitShortCut)) {
unitShortCut = "%%";
}
if (sensorType.toString().contains("TEMPERATURE")) {
* {@link SupportedThingTypes} enum has to be adjusted, if new device types of digitalSTROM should be supported.
* Provided the new digitalSTROM devices uses the same mechanism like now.
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
@Component(service = ThingTypeProvider.class)
public class DsDeviceThingTypeProvider extends BaseDsI18n implements ThingTypeProvider {
* used as thing type id, the first field will set the responsible handler and the last enum field will set the
* supporting of the power sensor refresh configurations (config-description with refresh priority setting or not).
*
- * @author Michael Ochel - initial contributer
- * @author Matthias Siegele - initial contributer
+ * @author Michael Ochel - Initial contribution
+ * @author Matthias Siegele - Initial contribution
*/
public static enum SupportedThingTypes {
// ThingType, responsible ThingHanlder, Device config-description with power-sensors
private final Logger logger = LoggerFactory.getLogger(DsDeviceThingTypeProvider.class);
- private final String DEVICE_WITH_POWER_SENSORS = "thing-type:digitalstrom:deviceWithPowerSensors";
- private final String DEVICE_WITHOUT_POWER_SENSORS = "thing-type:digitalstrom:deviceWithoutPowerSensors";
+ private static final String DEVICE_WITH_POWER_SENSORS = "thing-type:digitalstrom:deviceWithPowerSensors";
+ private static final String DEVICE_WITHOUT_POWER_SENSORS = "thing-type:digitalstrom:deviceWithoutPowerSensors";
@Activate
@Override