2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.digitalstrom.internal.lib.structure.devices;
15 import org.openhab.binding.digitalstrom.internal.lib.listener.DeviceStatusListener;
16 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl.DSID;
19 * The {@link GeneralDeviceInformations} interface contains all informations of digitalSTROM devices, which are
20 * identical for all device types. It also contains the methods to implement the mechanism of the
21 * {@link DeviceStatusListener}.
23 * @author Michael Ochel - Initial contribution
24 * @author Matthias Siegele - Initial contribution
26 public interface GeneralDeviceInformation {
29 * Returns the user defined name of this device.
31 * @return name of this device
36 * Sets the name of this device;
40 void setName(String name);
43 * Returns the dSID of this device.
45 * @return {@link DSID} dSID
50 * Returns the dSUID of this device.
57 * This device is available in his zone or not.
58 * Every 24h the dSM (meter) checks, if the devices are
61 * @return true, if device is available otherwise false
66 * Sets this device is available in his zone or not.
68 * @param isPresent (true = available | false = not available)
70 void setIsPresent(boolean isPresent);
73 * Register a {@link DeviceStatusListener} to this {@link Device}.
75 * @param deviceStatuslistener to register
77 void registerDeviceStatusListener(DeviceStatusListener deviceStatuslistener);
80 * Unregister the {@link DeviceStatusListener} to this {@link Device} if it exists.
82 * @return the unregistered {@link DeviceStatusListener} or null if no one was registered
84 DeviceStatusListener unregisterDeviceStatusListener();
87 * Returns true, if a {@link DeviceStatusListener} is registered to this {@link Device}, otherwise false.
89 * @return return true, if a lister is registered, otherwise false
91 boolean isListenerRegisterd();
94 * Returns true, if this device is valid, otherwise false.
96 * @return true, if valid
101 * Sets the valid state.
103 * @param isValid the new valid state
105 void setIsValid(boolean isValid);
108 * Returns the in the digitalSTROM web interface displayed dSID.
110 * @return displayed dSID
112 String getDisplayID();
115 * Returns the registered {@link DeviceStatusListener} or null, if no {@link DeviceStatusListener} is registered
117 * @return the registered {@link DeviceStatusListener} or null
119 DeviceStatusListener getDeviceStatusListener();