use of org.eclipse.smarthome.core.thing.ThingTypeUID in project smarthome by eclipse.
the class SceneDiscoveryService method getThingUID.
private ThingUID getThingUID(InternalScene scene) {
ThingUID bridgeUID = bridgeHandler.getThing().getUID();
ThingTypeUID thingTypeUID = new ThingTypeUID(BINDING_ID, sceneType);
if (getSupportedThingTypes().contains(thingTypeUID)) {
String thingSceneId = scene.getID();
ThingUID thingUID = new ThingUID(thingTypeUID, bridgeUID, thingSceneId);
return thingUID;
} else {
return null;
}
}
use of org.eclipse.smarthome.core.thing.ThingTypeUID in project smarthome by eclipse.
the class BlueZHandlerFactory method createHandler.
@Override
protected ThingHandler createHandler(Thing thing) {
ThingTypeUID thingTypeUID = thing.getThingTypeUID();
if (thingTypeUID.equals(BlueZAdapterConstants.THING_TYPE_BLUEZ)) {
BlueZBridgeHandler handler = new BlueZBridgeHandler((Bridge) thing);
registerBluetoothAdapter(handler);
return handler;
} else {
return null;
}
}
use of org.eclipse.smarthome.core.thing.ThingTypeUID in project smarthome by eclipse.
the class AstroHandlerFactory method createHandler.
@Override
protected ThingHandler createHandler(Thing thing) {
ThingTypeUID thingTypeUID = thing.getThingTypeUID();
AstroThingHandler thingHandler = null;
if (thingTypeUID.equals(THING_TYPE_SUN)) {
thingHandler = new SunHandler(thing);
} else if (thingTypeUID.equals(THING_TYPE_MOON)) {
thingHandler = new MoonHandler(thing);
}
if (thingHandler != null) {
ASTRO_THING_HANDLERS.put(thing.getUID().toString(), thingHandler);
}
return thingHandler;
}
use of org.eclipse.smarthome.core.thing.ThingTypeUID in project smarthome by eclipse.
the class ZoneTemperatureControlDiscoveryService method getThingUID.
private ThingUID getThingUID(TemperatureControlStatus tempControlStatus) {
ThingTypeUID thingTypeUID = new ThingTypeUID(BINDING_ID, thingTypeID);
if (getSupportedThingTypes().contains(thingTypeUID)) {
String thingID = tempControlStatus.getZoneID().toString();
ThingUID thingUID = new ThingUID(thingTypeUID, bridgeUID, thingID);
return thingUID;
} else {
return null;
}
}
use of org.eclipse.smarthome.core.thing.ThingTypeUID in project smarthome by eclipse.
the class TradfriDiscoveryServiceTest method setUp.
@Before
public void setUp() {
initMocks(this);
when(handler.getThing()).thenReturn(BridgeBuilder.create(GATEWAY_TYPE_UID, "1").build());
discovery = new TradfriDiscoveryService(handler);
listener = new DiscoveryListener() {
@Override
public void thingRemoved(DiscoveryService source, ThingUID thingUID) {
}
@Override
public void thingDiscovered(DiscoveryService source, DiscoveryResult result) {
discoveryResult = result;
}
@Override
public Collection<ThingUID> removeOlderResults(DiscoveryService source, long timestamp, Collection<ThingTypeUID> thingTypeUIDs, ThingUID bridgeUID) {
return null;
}
};
discovery.addDiscoveryListener(listener);
}
Aggregations