Search in sources :

Example 6 with ManagedThingProvider

use of org.eclipse.smarthome.core.thing.ManagedThingProvider in project smarthome by eclipse.

the class TradfriHandlerTest method setUp.

@Before
public void setUp() {
    registerService(volatileStorageService);
    managedThingProvider = getService(ThingProvider.class, ManagedThingProvider.class);
    Map<String, Object> properties = new HashMap<>();
    properties.put(GATEWAY_CONFIG_HOST, "1.2.3.4");
    properties.put(GATEWAY_CONFIG_IDENTITY, "identity");
    properties.put(GATEWAY_CONFIG_PRE_SHARED_KEY, "pre-shared-secret-key");
    bridge = BridgeBuilder.create(GATEWAY_TYPE_UID, "1").withLabel("My Gateway").withConfiguration(new Configuration(properties)).build();
    properties = new HashMap<>();
    properties.put(CONFIG_ID, "65537");
    thing = ThingBuilder.create(THING_TYPE_DIMMABLE_LIGHT, "1").withLabel("My Bulb").withBridge(bridge.getUID()).withConfiguration(new Configuration(properties)).build();
}
Also used : ThingProvider(org.eclipse.smarthome.core.thing.ThingProvider) ManagedThingProvider(org.eclipse.smarthome.core.thing.ManagedThingProvider) Configuration(org.eclipse.smarthome.config.core.Configuration) HashMap(java.util.HashMap) ManagedThingProvider(org.eclipse.smarthome.core.thing.ManagedThingProvider) Before(org.junit.Before)

Aggregations

ManagedThingProvider (org.eclipse.smarthome.core.thing.ManagedThingProvider)6 ItemRegistry (org.eclipse.smarthome.core.items.ItemRegistry)3 Before (org.junit.Before)3 Configuration (org.eclipse.smarthome.config.core.Configuration)2 Item (org.eclipse.smarthome.core.items.Item)2 StringItem (org.eclipse.smarthome.core.library.items.StringItem)2 ThingProvider (org.eclipse.smarthome.core.thing.ThingProvider)2 ThingRegistry (org.eclipse.smarthome.core.thing.ThingRegistry)2 VolatileStorageService (org.eclipse.smarthome.test.storage.VolatileStorageService)2 Test (org.junit.Test)2 URI (java.net.URI)1 HashMap (java.util.HashMap)1 Hashtable (java.util.Hashtable)1 Locale (java.util.Locale)1 ColorItem (org.eclipse.smarthome.core.library.items.ColorItem)1 DimmerItem (org.eclipse.smarthome.core.library.items.DimmerItem)1 NumberItem (org.eclipse.smarthome.core.library.items.NumberItem)1 SwitchItem (org.eclipse.smarthome.core.library.items.SwitchItem)1 ReadyMarker (org.eclipse.smarthome.core.service.ReadyMarker)1 ReadyService (org.eclipse.smarthome.core.service.ReadyService)1