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