]> git.basschouten.com Git - openhab-addons.git/blob
7766f4b38731d21f4e1f42a2fa714ee2d3c8aca0
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.digitalstrom.internal.lib.structure.devices;
14
15 import java.util.List;
16 import java.util.Map;
17
18 import org.openhab.binding.digitalstrom.internal.lib.config.Config;
19 import org.openhab.binding.digitalstrom.internal.lib.event.types.EventItem;
20 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.DeviceSceneSpec;
21 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.DeviceStateUpdate;
22 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.DeviceBinarayInputEnum;
23 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.FunctionalColorGroupEnum;
24 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.OutputModeEnum;
25 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.SensorEnum;
26 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl.DSID;
27 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl.DeviceBinaryInput;
28 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl.DeviceSensorValue;
29 import org.openhab.binding.digitalstrom.internal.lib.structure.scene.InternalScene;
30
31 /**
32  * The {@link Device} represents a digitalSTROM internal stored device.
33  *
34  * @author Alexander Betker - Initial contribution
35  * @author Michael Ochel - add methods for ESH, new functionalities and JavaDoc
36  * @author Mathias Siegele - add methods for ESH, new functionalities and JavaDoc
37  */
38 public interface Device extends GeneralDeviceInformation {
39
40     /**
41      * Returns the id of the dS-Meter in which the device is registered.
42      *
43      * @return meterDSID
44      */
45     DSID getMeterDSID();
46
47     /**
48      * Sets the id of the dS-Meter in which the device is registered.
49      *
50      * @param meterDSID to set
51      */
52
53     void setMeterDSID(String meterDSID);
54
55     /**
56      * Returns the hardware info of this device.
57      * You can see all available hardware info at
58      * http://www.digitalstrom.com/Partner/Support/Techn-Dokumentation/
59      *
60      * @return hardware info
61      */
62     String getHWinfo();
63
64     /**
65      * Returns the zone id in which this device is in.
66      *
67      * @return zoneID
68      */
69     int getZoneId();
70
71     /**
72      * Sets the zoneID of this device.
73      *
74      * @param zoneID to set
75      */
76     void setZoneId(int zoneID);
77
78     /**
79      * Returns true, if this device is on, otherwise false.
80      *
81      * @return is on (true = on | false = off)
82      */
83     boolean isOn();
84
85     /**
86      * Adds an on command as {@link DeviceStateUpdate}, if the flag is true or off command, if it is false to the list
87      * of
88      * outstanding commands.
89      *
90      * @param flag (true = on | false = off)
91      */
92     void setIsOn(boolean flag);
93
94     /**
95      * Returns true, if this shade device is open, otherwise false.
96      *
97      * @return is on (true = open | false = closed)
98      */
99     boolean isOpen();
100
101     /**
102      * Adds an open command as {@link DeviceStateUpdate}, if the flag is true or closed command, if it is false to the
103      * list of outstanding commands.
104      *
105      * @param flag (true = open | false = closed)
106      */
107     void setIsOpen(boolean flag);
108
109     /**
110      * Returns true, if this device is dimmable, otherwise false.
111      *
112      * @return is dimmable (true = yes | false = no)
113      */
114     boolean isDimmable();
115
116     /**
117      * Returns true, if this device is a shade device (grey), otherwise false.
118      *
119      * @return is shade (true = yes | false = no)
120      */
121     boolean isShade();
122
123     /**
124      * Returns true, if the device output mode isn't disabled.
125      *
126      * @return have output mode (true = yes | false = no)
127      */
128     boolean isDeviceWithOutput();
129
130     /**
131      * Returns the current functional color group of this device.
132      * For more informations please have a look at {@link FunctionalColorGroupEnum}.
133      *
134      * @return current functional color group
135      */
136     FunctionalColorGroupEnum getFunctionalColorGroup();
137
138     /**
139      * Sets the functional color group of this device.
140      *
141      * @param fuctionalColorGroup to set
142      */
143     void setFunctionalColorGroup(FunctionalColorGroupEnum fuctionalColorGroup);
144
145     /**
146      * Returns the current output mode of this device.
147      * Some devices are able to have different output modes e.g. the device GE-KM200 is able to
148      * be in dimm mode, switch mode or disabled.
149      * For more informations please have a look at {@link OutputModeEnum}.
150      *
151      * @return the current output mode of this device
152      */
153     OutputModeEnum getOutputMode();
154
155     /**
156      * Adds an increase command as {@link DeviceStateUpdate} to the list of outstanding commands.
157      */
158     void increase();
159
160     /**
161      * Adds an decrease command as {@link DeviceStateUpdate} to the list of outstanding commands.
162      */
163     void decrease();
164
165     /**
166      * Returns the current slat position of this device.
167      *
168      * @return current slat position
169      */
170     int getSlatPosition();
171
172     /**
173      * Adds an set slat position command as {@link DeviceStateUpdate} with the given slat position to the list of
174      * outstanding commands.
175      *
176      * @param slatPosition to set
177      */
178     void setSlatPosition(int slatPosition);
179
180     /**
181      * Returns the maximal slat position value of this device.
182      *
183      * @return maximal slat position value
184      */
185     int getMaxSlatPosition();
186
187     /**
188      * Returns the minimal slat position value of this device.
189      *
190      * @return minimal slat position value
191      */
192     int getMinSlatPosition();
193
194     /**
195      * Returns the current output value of this device.
196      * This can be the slat position or the brightness of this device.
197      *
198      * @return current output value
199      */
200     short getOutputValue();
201
202     /**
203      * Adds an set output value command as {@link DeviceStateUpdate} with the given output value to the list of
204      * outstanding commands.
205      *
206      * @param outputValue to set
207      */
208     void setOutputValue(short outputValue);
209
210     /**
211      * Returns the maximal output value of this device.
212      *
213      * @return maximal output value
214      */
215     short getMaxOutputValue();
216
217     /**
218      * Returns a list with group id's in which the device is part of.
219      *
220      * @return List of group id's
221      */
222     List<Short> getGroups();
223
224     /**
225      * Adds the given groupID to the group list.
226      *
227      * @param groupID to add
228      */
229     void addGroup(Short groupID);
230
231     /**
232      * Overrides the existing group list with the given new.
233      *
234      * @param newGroupList to set
235      */
236     void setGroups(List<Short> newGroupList);
237
238     /**
239      * Returns the scene output value of this device of the given scene id as {@link Integer} array. The first field is
240      * the output value and the second is the angle value or -1 if no angle value exists.
241      * If the method returns null, this scene id isn't read yet.
242      *
243      * @param sceneID of the scene
244      * @return scene output value and scene angle value or null, if it isn't read out yet
245      */
246     Integer[] getSceneOutputValue(short sceneID);
247
248     /**
249      * Sets the scene output value of this device for the given scene id and scene output value.
250      *
251      * @param sceneId to set
252      * @param sceneOutputValue to set
253      */
254     void setSceneOutputValue(short sceneId, int sceneOutputValue);
255
256     /**
257      * This configuration is very important. The devices can
258      * be configured to not react to some commands (scene calls).
259      * So you can't imply that a device automatically turns on (by default yes,
260      * but if someone configured his own scenes, then maybe not) after a
261      * scene call. This method returns true or false, if the configuration
262      * for this sceneID already has been read
263      *
264      * @param sceneId the sceneID
265      * @return true if this device has the configuration for this specific scene
266      */
267     boolean containsSceneConfig(short sceneId);
268
269     /**
270      * Add the config for this scene. The config has the configuration
271      * for the specific sceneID.
272      *
273      * @param sceneId scene call id
274      * @param sceneSpec config for this sceneID
275      */
276     void addSceneConfig(short sceneId, DeviceSceneSpec sceneSpec);
277
278     /**
279      * Get the config for this scene. The config has the configuration
280      * for the specific sceneID.
281      *
282      * @param sceneId scene call id
283      * @return sceneSpec config for this sceneID
284      */
285     DeviceSceneSpec getSceneConfig(short sceneId);
286
287     /**
288      * Should the device react on this scene call or not .
289      *
290      * @param sceneId scene call id
291      * @return true, if this device should react on this sceneID
292      */
293     boolean doIgnoreScene(short sceneId);
294
295     // follow methods added by Michael Ochel and Matthias Siegele
296     /**
297      * Returns true, if all sensor data are up to date or false if some have to be updated.
298      *
299      * @return is up to date (true = yes | false = no)
300      */
301     boolean isSensorDataUpToDate();
302
303     /**
304      * Sets the priority to refresh the data of the sensors to the given priorities.
305      * They can be never, low, medium or high.
306      *
307      * @param powerConsumptionRefreshPriority to set
308      * @param electricMeterRefreshPriority to set
309      * @param energyMeterRefreshPriority to set
310      */
311     void setSensorDataRefreshPriority(String powerConsumptionRefreshPriority, String electricMeterRefreshPriority,
312             String energyMeterRefreshPriority);
313
314     /**
315      * Returns true, if the device is up to date.
316      *
317      * @return digitalSTROM-Device is up to date (true = yes | false = no)
318      */
319     boolean isDeviceUpToDate();
320
321     /**
322      * Returns the next {@link DeviceStateUpdate} to update the digitalSTROM-Device on the digitalSTROM-Server.
323      *
324      * @return DeviceStateUpdate for digitalSTROM-Device
325      */
326     DeviceStateUpdate getNextDeviceUpdateState();
327
328     /**
329      * Update the internal stored device object.
330      *
331      * @param deviceStateUpdate to update
332      */
333     void updateInternalDeviceState(DeviceStateUpdate deviceStateUpdate);
334
335     /**
336      * Call the given {@link InternalScene} on this {@link Device} and updates it.
337      *
338      * @param scene to call
339      */
340     void callInternalScene(InternalScene scene);
341
342     /**
343      * Undo the given {@link InternalScene} on this {@link Device} and updates it.
344      *
345      * @param scene to undo
346      */
347     void undoInternalScene(InternalScene scene);
348
349     /**
350      * Initial a call scene for the given scene number.
351      *
352      * @param sceneNumber to call
353      */
354     void callScene(Short sceneNumber);
355
356     /**
357      * Returns the current active {@link InternalScene}, otherwise null.
358      *
359      * @return active {@link InternalScene} or null
360      */
361     InternalScene getAcitiveScene();
362
363     /**
364      * Undo the active scene if a scene is active.
365      */
366     void undoScene();
367
368     /**
369      * Checks the scene configuration for the given scene number and initial a scene configuration reading with the
370      * given priority if no scene configuration exists.
371      *
372      * @param sceneNumber to check
373      * @param prio to update
374      */
375     void checkSceneConfig(Short sceneNumber, short prio);
376
377     /**
378      * Sets the given output mode as new output mode of this {@link Device}.
379      *
380      * @param newOutputMode to set
381      */
382     void setOutputMode(OutputModeEnum newOutputMode);
383
384     /**
385      * Returns a {@link List} of all saved scene-IDs configurations.
386      *
387      * @return a {@link List} of all saved scene-IDs
388      */
389     List<Short> getSavedScenes();
390
391     /**
392      * Initializes a internal device update as call scene for the given scene number.
393      *
394      * @param sceneNumber to call
395      */
396     void internalCallScene(Short sceneNumber);
397
398     /**
399      * Initializes a internal device update as undo scene.
400      */
401     void internalUndoScene();
402
403     /**
404      * Returns true, if this {@link Device} is a device with a switch output mode.
405      *
406      * @return true, if it is a switch otherwise false
407      */
408     boolean isSwitch();
409
410     /**
411      * Sets the given {@link Config} as new {@link Config}.
412      *
413      * @param config to set
414      */
415     void setConfig(Config config);
416
417     /**
418      * Returns the current angle position of the {@link Device}.
419      *
420      * @return current angle position
421      */
422     short getAnglePosition();
423
424     /**
425      * Adds an set angle value command as {@link DeviceStateUpdate} with the given angle value to the list of
426      * outstanding commands.
427      *
428      * @param angle to set
429      */
430     void setAnglePosition(int angle);
431
432     /**
433      * Sets the scene output value and scene output angle of this device for the given scene id, scene output value and
434      * scene output angle.
435      *
436      * @param sceneId to set
437      * @param value to set
438      * @param angle to set
439      */
440     void setSceneOutputValue(short sceneId, int value, int angle);
441
442     /**
443      * Returns the max angle value of the slat.
444      *
445      * @return max slat angle
446      */
447     int getMaxSlatAngle();
448
449     /**
450      * Returns the min angle value of the slat.
451      *
452      * @return min slat angle
453      */
454     int getMinSlatAngle();
455
456     /**
457      * Returns true, if it is a blind device.
458      *
459      * @return is blind (true = yes | false = no
460      */
461     boolean isBlind();
462
463     /**
464      * Saves scene configurations from the given sceneProperties in the {@link Device}. <br>
465      * The {@link Map} has to be like the following format:
466      * <ul>
467      * <li><b>Key:</b> scene[sceneID]</li>
468      * <li><b>Value:</b> {Scene: [sceneID], dontcare: [don't care flag], localPrio: [local prio flag], specialMode:
469      * [special mode flag]}(0..1), {sceneValue: [scene value], sceneAngle: [scene angle]}(0..1))</li>
470      * </ul>
471      *
472      * @param sceneProperties to save
473      */
474     void saveConfigSceneSpecificationIntoDevice(Map<String, String> sceneProperties);
475
476     /**
477      * Returns the min output value.
478      *
479      * @return min output value
480      */
481     short getMinOutputValue();
482
483     /**
484      * Adds a slat increase command as {@link DeviceStateUpdate} to the list of outstanding commands.
485      */
486     void increaseSlatAngle();
487
488     /**
489      * Adds a slat decrease command as {@link DeviceStateUpdate} to the list of outstanding commands.
490      */
491     void decreaseSlatAngle();
492
493     /**
494      * Saves scene configurations from the given sceneProperties in the {@link Device}. <br>
495      * <br>
496      * <b>The {@link String} has to be like the following format:</b><br>
497      * {[sceneID] = }(1){Scene: [sceneID], dontcare: [don't care flag], localPrio: [local prio flag], specialMode:
498      * [special mode flag]}(0..1), {sceneValue: [sceneValue]{, sceneAngle: [scene angle]}(0..1)}{\n}(0..1)<br>
499      * <br>
500      * e.g. "10 = Scene: PRESET_4, dontcare: false, localPrio: false, specialMode: false, flashMode: false, sceneValue:
501      * 0\n"
502      *
503      * @param propertries to save
504      */
505     void saveConfigSceneSpecificationIntoDevice(String propertries);
506
507     /**
508      * Returns true, if this {@link Device} is a sensor device. That means, that this {@link Device} has no output
509      * channel
510      * ({@link OutputModeEnum#DISABLED}), but climate sensors.
511      *
512      * @return true, if it is a sensor device
513      */
514     boolean isSensorDevice();
515
516     /**
517      * Returns true, if this {@link Device} is a heating device. That means, that the output mode of this {@link Device}
518      * is one of the following modes {@link OutputModeEnum#PWM} or {@link OutputModeEnum#SWITCH} and the
519      * {@link FuncNameAndColorGroupEnum} is {@link FuncNameAndColorGroupEnum#HEATING}.
520      *
521      * @return true, if it is a heating device
522      */
523     boolean isHeatingDevice();
524
525     /**
526      * Sets the refresh priority for the given power sensor as {@link SensorEnum}. <br>
527      * <b>Note:</b><br>
528      * 1. The device must have this sensor type, otherwise the set has no effect.<br>
529      * <br>
530      * 2. Valid priorities are:<br>
531      * - {@link Config#REFRESH_PRIORITY_NEVER}<br>
532      * - {@link Config#REFRESH_PRIORITY_LOW}<br>
533      * - {@link Config#REFRESH_PRIORITY_MEDIUM}<br>
534      * - {@link Config#REFRESH_PRIORITY_HIGH}<br>
535      * <br>
536      * 3. Valid sensor types are:<br>
537      * - {@link SensorEnum#POWER_CONSUMPTION}<br>
538      * - {@link SensorEnum#OUTPUT_CURRENT}<br>
539      * - {@link SensorEnum#ELECTRIC_METER}<br>
540      * - {@link SensorEnum#ACTIVE_POWER}<br>
541      *
542      * @param powerSensorType the power sensor to set
543      * @param refreshPriority the new refresh priority
544      */
545     void setSensorDataRefreshPriority(SensorEnum powerSensorType, String refreshPriority);
546
547     /**
548      * Returns the refresh priority of the given power sensor type as {@link SensorEnum}. If the sensor type is not
549      * supported by
550      * this {@link Device} or it is not a power sensor it will be returned null.
551      *
552      * @param powerSensorType of the sensor
553      * @return the refresh priority
554      */
555     String getPowerSensorRefreshPriority(SensorEnum powerSensorType);
556
557     /**
558      * Returns a {@link List} with all power sensors, which are supported by this {@link Device}.
559      *
560      * @return all supported power sensors
561      */
562     List<SensorEnum> getPowerSensorTypes();
563
564     /**
565      * Returns a {@link List} with all climate sensors, which are supported by this {@link Device}.
566      *
567      * @return all supported climate sensors
568      */
569     List<SensorEnum> getClimateSensorTypes();
570
571     /**
572      * Returns all {@link DeviceSensorValue}'s of this {@link Device}.
573      *
574      * @return list of all {@link DeviceSensorValue}'s
575      */
576     List<DeviceSensorValue> getDeviceSensorValues();
577
578     /**
579      * Sets the given {@link DeviceSensorValue}. That means the given {@link DeviceSensorValue} will be added, if this
580      * type of {@link DeviceSensorValue} does not exist before, otherwise the existing {@link DeviceSensorValue} will be
581      * updated,
582      * if the given {@link DeviceSensorValue} is newer.
583      *
584      * @param deviceSensorValue the new device sensor value
585      */
586     void setDeviceSensorValue(DeviceSensorValue deviceSensorValue);
587
588     /**
589      * Returns the {@link DeviceSensorValue} of the given sensor type as {@link SensorEnum} or null, if no
590      * {@link DeviceSensorValue} exists for the given sensor type.
591      *
592      * @param sensorType of the sensor
593      * @return the {@link DeviceSensorValue} or null
594      */
595     DeviceSensorValue getDeviceSensorValue(SensorEnum sensorType);
596
597     /**
598      * Returns the {@link DeviceSensorValue} of the given sensor index as {@link Short} or null, if no
599      * {@link DeviceSensorValue} exists for the given sensor index.
600      *
601      * @param sensorIndex of the sensor
602      * @return the {@link DeviceSensorValue} or null
603      */
604     DeviceSensorValue getDeviceSensorValue(Short sensorIndex);
605
606     /**
607      * Returns the sensor index for the given sensor type as {@link SensorEnum} of the {@link Device} or null, if the
608      * sensor type does not exist. It will be needed to readout the current sensor value of the digitalSTROM device.
609      *
610      * @param sensorType of the sensor
611      * @return sensor index for the sensor type
612      */
613     Short getSensorIndex(SensorEnum sensorType);
614
615     /**
616      * Returns the sensor type as {@link SensorEnum} of the given sensor index or null, if the given sensor type does
617      * not exist.
618      *
619      * @param sensorIndex of the sensor
620      * @return the sensor type or null
621      */
622     SensorEnum getSensorType(Short sensorIndex);
623
624     /**
625      * Returns the internal digitalSTROM sensor value for the given sensor type as {@link SensorEnum}, if the sensor
626      * type exists and the value is valid. The resolution can be found at {@link SensorEnum}.
627      *
628      * @param sensorType of the sensor
629      * @return the internal digitalSTROM sensor value or null
630      */
631     Integer getDsSensorValue(SensorEnum sensorType);
632
633     /**
634      * Returns the internal digitalSTROM sensor value for the given sensor index as {@link Short}, if the sensor
635      * index exists and the value is valid. The resolution can be found at {@link SensorEnum}.
636      *
637      * @param sensorIndex of the sensor
638      * @return the internal digitalSTROM sensor value or null
639      */
640     Integer getDsSensorValue(Short sensorIndex);
641
642     /**
643      * Returns the float sensor value for the given sensor type as {@link SensorEnum}, if the sensor
644      * type exists and the value is valid. The resolution can be found at {@link SensorEnum}.
645      *
646      * @param sensorType of the sensor
647      * @return the float sensor value or null
648      */
649     Float getFloatSensorValue(SensorEnum sensorType);
650
651     /**
652      * Returns the float sensor value for the given sensor index as {@link Short}, if the sensor
653      * index exists and the value is valid. The resolution can be found at {@link SensorEnum}.
654      *
655      * @param sensorIndex of the sensor
656      * @return the float sensor value or null
657      */
658     Float getFloatSensorValue(Short sensorIndex);
659
660     /**
661      * Sets the float sensor value for a given sensor type as {@link SensorEnum}. If the sensor type does not exist, it
662      * will be returned false.
663      *
664      * @param sensorType of the sensor
665      * @param floatSensorValue the new float sensor value
666      * @return true, if it was successful, otherwise false
667      */
668     boolean setFloatSensorValue(SensorEnum sensorType, Float floatSensorValue);
669
670     /**
671      * Sets the float sensor value for a given sensor index as {@link Short}. If the sensor type does not exist, it
672      * will be returned false.
673      *
674      * @param sensorIndex of the sensor
675      * @param floatSensorValue the new float sensor value
676      * @return true, if it was successful, otherwise false
677      */
678     boolean setFloatSensorValue(Short sensorIndex, Float floatSensorValue);
679
680     /**
681      * Sets the internal digitalSTROM sensor value for a given sensor index as {@link Short}. If the sensor index does
682      * not exist, it will be returned false.
683      *
684      * @param sensorIndex of the sensor
685      * @param dSSensorValue the new internal digitalSTROM sensor value
686      * @return true, if it was successful, otherwise false
687      */
688     boolean setDsSensorValue(Short sensorIndex, Integer dSSensorValue);
689
690     /**
691      * Sets the internal digitalSTROM sensor value for a given sensor type as {@link SensorEnum}. If the sensor type
692      * does
693      * not exist, it will be returned false.
694      *
695      * @param sensorType of the sensor
696      * @param dSSensorValue the new internal digitalSTROM sensor value
697      * @return true, if it was successful, otherwise false
698      */
699     boolean setDsSensorValue(SensorEnum sensorType, Integer dSSensorValue);
700
701     /**
702      * Sets the internal digitalSTROM and float sensor value for a given sensor index as {@link Short}. If the sensor
703      * index does not exist, it will be returned false.
704      *
705      * @param sensorIndex of the sensor
706      * @param dSSensorValue the new internal digitalSTROM sensor value
707      * @param floatSensorValue the new float sensor value
708      * @return true, if it was successful, otherwise false
709      */
710     boolean setDsSensorValue(Short sensorIndex, Integer dSSensorValue, Float floatSensorValue);
711
712     /**
713      * Sets the internal digitalSTROM and float sensor value for a given sensor type as {@link SensorEnum}. If the
714      * sensor type does not exist, it will be returned false.
715      *
716      * @param sensorType of the sensor
717      * @param dSSensorValue the new internal digitalSTROM sensor value
718      * @param floatSensorValue the new float sensor value
719      * @return true, if it was successful, otherwise false
720      */
721     boolean setDsSensorValue(SensorEnum sensorType, Integer dSSensorValue, Float floatSensorValue);
722
723     /**
724      * Returns true, if this {@link Device} has sensors, otherwise false.
725      *
726      * @return true, if device has sensors
727      */
728     boolean hasSensors();
729
730     /**
731      * Returns true, if this {@link Device} has climate sensors, otherwise false.
732      *
733      * @return true, if device has climate sensors
734      */
735     boolean hasClimateSensors();
736
737     /**
738      * Returns true, if this {@link Device} has power sensors, otherwise false.
739      *
740      * @return true, if device has power sensors
741      */
742     boolean hasPowerSensors();
743
744     /**
745      * Only needed for {@link DeviceConsumptionSensorJob}'s. To set the internal digitalSTROM sensor value please use
746      * {@link #setDsSensorValue(SensorEnum, Integer)}.
747      *
748      * @param sensorType of the sensor
749      * @param value new value
750      */
751     void setDeviceSensorDsValueBySensorJob(SensorEnum sensorType, Integer value);
752
753     /**
754      * Enables the internal sensor echo box for {@link EventNames#DEVICE_SENSOR_VALUE} events.
755      */
756     void enableSensorEchoBox();
757
758     /**
759      * Disables the internal sensor echo box for {@link EventNames#DEVICE_SENSOR_VALUE} events.
760      */
761     void disableSensorEchoBox();
762
763     /**
764      * Returns true, if the internal sensor echo box is enabled, otherwise false.
765      *
766      * @return true, if the internal sensor echo box is enabled
767      */
768     boolean isSensorEchoBoxEnabled();
769
770     /**
771      * Sets the {@link DeviceSensorValue} through a {@link EventItem} of the type
772      * {@link EventNames#DEVICE_SENSOR_VALUE}.
773      *
774      * @param event of the sensor update
775      */
776     void setDeviceSensorByEvent(EventItem event);
777
778     /**
779      * Returns true, if the refresh priority of the given power sensor type as {@link SensorEnum} is equals
780      * {@link Config#REFRESH_PRIORITY_NEVER}, otherwise false.
781      *
782      * @param powerSensorType of the sensor
783      * @return true, if refresh priority is never
784      */
785     boolean checkPowerSensorRefreshPriorityNever(SensorEnum powerSensorType);
786
787     /**
788      * Returns true, if the given sensor type as {@link SensorEnum} is supported by this {@link Device}, otherwise
789      * false.
790      *
791      * @param sensorType of the sensor
792      * @return true, if the sensor type is supported
793      */
794     boolean supportsSensorType(SensorEnum sensorType);
795
796     /**
797      * Returns true, if this {@link Device} is a temperature controlled device, otherwise false. That means, that the
798      * output mode is one of the output modes in
799      * {@link OutputModeEnum#outputModeIsTemperationControlled(OutputModeEnum)}.
800      *
801      * @return true, if this {@link Device} is a temperature controlled
802      */
803     boolean isTemperatureControlledDevice();
804
805     /**
806      * Returns true, if this {@link Device} is a binary input device. That means it have no output mode
807      * ({@link OutputModeEnum#DISABLED}), but {@link DeviceBinaryInput}'s.
808      *
809      * @return true, if this {@link Device} is a binary input device
810      */
811     boolean isBinaryInputDevice();
812
813     /**
814      * Returns a {@link List} which contains all currently configured {@link DeviceBinaryInput}'s.
815      *
816      * @return list with all configured {@link DeviceBinaryInput}'s
817      */
818     List<DeviceBinaryInput> getBinaryInputs();
819
820     /**
821      * Returns the {@link DeviceBinaryInput} of the given binary input type as {@link DeviceBinarayInputEnum}} or null,
822      * if the binary input type does not exist.
823      *
824      * @param binaryInputType of the {@link DeviceBinaryInput}
825      * @return the {@link DeviceBinaryInput} or null
826      */
827     DeviceBinaryInput getBinaryInput(DeviceBinarayInputEnum binaryInputType);
828
829     /**
830      * Returns the state of the given binary input type as {@link DeviceBinarayInputEnum}} or null, if the binary input
831      * type does not exist.
832      *
833      * @param binaryInputType of the {@link DeviceBinaryInput}
834      * @return state of the given binary input type or null
835      */
836     Short getBinaryInputState(DeviceBinarayInputEnum binaryInputType);
837
838     /**
839      * Sets the state of an existing {@link DeviceBinaryInput}. If the given {@link DeviceBinarayInputEnum} does not
840      * exist, it will returned false, otherwise true.
841      *
842      * @param binaryInputType of the {@link DeviceBinaryInput}
843      * @param newState the new state
844      * @return true, if it was successful, otherwise false
845      */
846     boolean setBinaryInputState(DeviceBinarayInputEnum binaryInputType, Short newState);
847
848     /**
849      * Sets the given {@link List} of {@link DeviceBinaryInput}'s as supported binary inputs.
850      *
851      * @param newBinaryInputs to set
852      */
853     void setBinaryInputs(List<DeviceBinaryInput> newBinaryInputs);
854
855     /**
856      * Returns true, if the given power sensor type as {@link SensorEnum} is up to date and does not need a refresh,
857      * otherwise it will returned false.
858      *
859      * @param powerSensorType of the sensor
860      * @return true, if the power sensor is up to date
861      */
862     boolean isPowerSensorUpToDate(SensorEnum powerSensorType);
863
864     /**
865      * Returns a {@link List} of all supported sensor types as {@link SensorEnum}.
866      *
867      * @return all supported sensor types
868      */
869     List<SensorEnum> getSensorTypes();
870 }