use of org.eclipse.smarthome.config.core.Configuration in project smarthome by eclipse.
the class SacnBridgeHandlerTest method setUp.
@Before
public void setUp() {
bridgeProperties = new HashMap<>();
bridgeProperties.put(CONFIG_ADDRESS, TEST_ADDRESS);
bridgeProperties.put(CONFIG_UNIVERSE, TEST_UNIVERSE);
bridgeProperties.put(CONFIG_SACN_MODE, "unicast");
bridge = BridgeBuilder.create(THING_TYPE_SACN_BRIDGE, "sacnbridge").withLabel("sACN Bridge").withChannel(ChannelBuilder.create(CHANNEL_UID_MUTE, "Switch").withType(MUTE_CHANNEL_TYPEUID).build()).withConfiguration(new Configuration(bridgeProperties)).build();
ThingHandlerCallback mockCallback = mock(ThingHandlerCallback.class);
doAnswer(answer -> {
((Thing) answer.getArgument(0)).setStatusInfo(answer.getArgument(1));
return null;
}).when(mockCallback).statusUpdated(any(), any());
bridgeHandler = new SacnBridgeHandler(bridge) {
@Override
protected void validateConfigurationParameters(Map<String, Object> configurationParameters) {
}
};
bridgeHandler.getThing().setHandler(bridgeHandler);
bridgeHandler.setCallback(mockCallback);
bridgeHandler.initialize();
}
use of org.eclipse.smarthome.config.core.Configuration in project smarthome by eclipse.
the class TunableWhiteThingHandlerTest method setUp.
@Before
public void setUp() {
super.setup();
thingProperties = new HashMap<>();
thingProperties.put(CONFIG_DMX_ID, TEST_CHANNEL_CONFIG);
thingProperties.put(CONFIG_DIMMER_FADE_TIME, TEST_FADE_TIME);
thingProperties.put(CONFIG_DIMMER_TURNONVALUE, "127,127");
dimmerThing = ThingBuilder.create(THING_TYPE_TUNABLEWHITE, "testdimmer").withLabel("Dimmer Thing").withBridge(bridge.getUID()).withConfiguration(new Configuration(thingProperties)).withChannel(ChannelBuilder.create(CHANNEL_UID_BRIGHTNESS, "Brightness").withType(BRIGHTNESS_CHANNEL_TYPEUID).build()).withChannel(ChannelBuilder.create(CHANNEL_UID_BRIGHTNESS_CW, "Brightness CW").withType(BRIGHTNESS_CHANNEL_TYPEUID).build()).withChannel(ChannelBuilder.create(CHANNEL_UID_BRIGHTNESS_WW, "Brightness WW").withType(BRIGHTNESS_CHANNEL_TYPEUID).build()).withChannel(ChannelBuilder.create(CHANNEL_UID_COLOR_TEMP, "Color temperature").withType(COLOR_TEMPERATURE_CHANNEL_TYPEUID).build()).build();
dimmerThingHandler = new TunableWhiteThingHandler(dimmerThing) {
@Override
@Nullable
protected Bridge getBridge() {
return bridge;
}
};
initializeHandler(dimmerThingHandler);
}
use of org.eclipse.smarthome.config.core.Configuration in project smarthome by eclipse.
the class RuleTemplateRegistry method copyActions.
private List<Action> copyActions(List<Action> actions) {
List<Action> res = new ArrayList<Action>();
if (actions != null) {
for (Action a : actions) {
Configuration c = new Configuration();
c.setProperties(a.getConfiguration().getProperties());
Action action = new Action(a.getId(), a.getTypeUID(), c, a.getInputs());
action.setLabel(a.getLabel());
action.setDescription(a.getDescription());
res.add(action);
}
}
return res;
}
use of org.eclipse.smarthome.config.core.Configuration in project smarthome by eclipse.
the class ModuleTypeRegistryImpl method copyConditions.
private static List<Condition> copyConditions(List<Condition> conditions) {
List<Condition> res = new ArrayList<Condition>(11);
if (conditions != null) {
for (Condition c : conditions) {
Configuration conf = new Configuration();
conf.setProperties(c.getConfiguration().getProperties());
Condition condition = new Condition(c.getId(), c.getTypeUID(), conf, new HashMap<String, String>(c.getInputs()));
condition.setLabel(condition.getLabel());
condition.setDescription(condition.getDescription());
res.add(condition);
}
}
return res;
}
use of org.eclipse.smarthome.config.core.Configuration in project smarthome by eclipse.
the class ModuleTypeRegistryImpl method copyActions.
private static List<Action> copyActions(List<Action> actions) {
List<Action> res = new ArrayList<Action>();
if (actions != null) {
for (Action a : actions) {
Configuration c = new Configuration();
c.setProperties(a.getConfiguration().getProperties());
Action action = new Action(a.getId(), a.getTypeUID(), c, a.getInputs());
action.setLabel(a.getLabel());
action.setDescription(a.getDescription());
res.add(action);
}
}
return res;
}
Aggregations