This repository has been archived by the owner on Oct 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c781603
commit 5ec8754
Showing
1 changed file
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ | |
import rst.domotic.unit.UnitConfigType.UnitConfig; | ||
import rst.rsb.ScopeType; | ||
|
||
/** | ||
/** | ||
* @author <a href="mailto:[email protected]">Divine Threepwood</a> | ||
*/ | ||
public class Units { | ||
|
@@ -385,7 +385,7 @@ public static UnitRemote getUnitByScope(final String scope, boolean waitForData) | |
throw new NotAvailableException("Unit[" + scope + "]", ex); | ||
} | ||
} | ||
|
||
/** | ||
* Method establishes a connection to the unit referred by the given unit label and location scope. | ||
* The returned unit remote object is fully synchronized with the unit controller and all states locally cached. | ||
|
@@ -424,6 +424,28 @@ public UnitRemote getUnitByLabelAndLocationScope(final String label, final Strin | |
} | ||
} | ||
|
||
// public enum UnitClass { | ||
// LIGHT(LightRemote.class); | ||
// | ||
// final Class unitRemoteClass; | ||
// | ||
// private UnitClass(final Class unitRemoteClass) { | ||
// this.unitRemoteClass = unitRemoteClass; | ||
// } | ||
// | ||
// public Class getUnitClass() { | ||
// return unitRemoteClass; | ||
// } | ||
// } | ||
// | ||
// public static <UR extends UnitRemote> UR getUnit(final String unitId, boolean waitForData, final UnitClass unitClass) throws NotAvailableException, InterruptedException { | ||
// try { | ||
// return (UR) getUnit(unitId, waitForData, unitClass.getUnitClass()); | ||
// } catch (ClassCastException ex) { | ||
// throw new NotAvailableException("Unit[" + unitId + "]", new InvalidStateException("Requested Unit[" + unitId + "] is not compatible with defined UnitRemoteClass[" + unitRemoteClass + "]!", ex)); | ||
// } | ||
// } | ||
|
||
public static LightRemote getLightUnit(final UnitConfig unitConfig, boolean waitForData) throws NotAvailableException, InterruptedException { | ||
return getUnit(unitConfig, waitForData, LightRemote.class); | ||
} | ||
|