use of org.openhab.io.hueemulation.internal.rest.mocks.DummyItemRegistry in project openhab-addons by openhab.
the class ItemUIDtoHueIDMappingTests method setUp.
@BeforeEach
public void setUp() throws IOException {
commonSetup = new CommonSetup(true);
commonSetup.start(new ResourceConfig());
itemRegistry = new DummyItemRegistry();
lightsAndGroups.cs = commonSetup.cs;
lightsAndGroups.eventPublisher = commonSetup.eventPublisher;
lightsAndGroups.userManagement = commonSetup.userManagement;
lightsAndGroups.itemRegistry = itemRegistry;
lightsAndGroups.activate();
}
use of org.openhab.io.hueemulation.internal.rest.mocks.DummyItemRegistry in project openhab-addons by openhab.
the class LightsAndGroupsTests method setUp.
@BeforeEach
public void setUp() throws IOException {
commonSetup = new CommonSetup(false);
itemRegistry = new DummyItemRegistry();
this.cs = commonSetup.cs;
subject.cs = cs;
subject.eventPublisher = commonSetup.eventPublisher;
subject.userManagement = commonSetup.userManagement;
subject.itemRegistry = itemRegistry;
subject.activate();
// Add simulated lights
cs.ds.lights.put("1", new HueLightEntry(new SwitchItem("switch"), "switch", DeviceType.SwitchType));
cs.ds.lights.put("2", new HueLightEntry(new ColorItem("color"), "color", DeviceType.ColorType));
cs.ds.lights.put("3", new HueLightEntry(new ColorItem("white"), "white", DeviceType.WhiteTemperatureType));
// Add group item
cs.ds.groups.put("10", new HueGroupEntry("name", new GroupItem("white", new SwitchItem("switch")), DeviceType.SwitchType));
commonSetup.start(new ResourceConfig().registerInstances(subject));
}
use of org.openhab.io.hueemulation.internal.rest.mocks.DummyItemRegistry in project openhab-addons by openhab.
the class RulesTests method setUp.
@BeforeEach
public void setUp() throws IOException {
commonSetup = new CommonSetup(false);
this.cs = commonSetup.cs;
itemRegistry = new DummyItemRegistry();
ruleRegistry = new DummyRuleRegistry();
subject.cs = commonSetup.cs;
subject.userManagement = commonSetup.userManagement;
subject.ruleRegistry = ruleRegistry;
subject.itemRegistry = itemRegistry;
subject.activate();
// We need the LightsAndGroups class to convert registry entries into HueDatastore
// light entries
lightsAndGroups.cs = cs;
lightsAndGroups.eventPublisher = commonSetup.eventPublisher;
lightsAndGroups.userManagement = commonSetup.userManagement;
lightsAndGroups.itemRegistry = itemRegistry;
lightsAndGroups.activate();
addItemToReg(new SwitchItem("switch1"), OnOffType.ON, "Switchable", "name1");
addItemToReg(new SwitchItem("switch2"), OnOffType.ON, "Switchable", "name2");
addItemToReg(new ColorItem("color1"), HSBType.BLUE, "ColorLighting", "");
commonSetup.start(new ResourceConfig().registerInstances(subject));
}
use of org.openhab.io.hueemulation.internal.rest.mocks.DummyItemRegistry in project openhab-addons by openhab.
the class SceneTests method setUp.
@BeforeEach
public void setUp() throws IOException {
commonSetup = new CommonSetup(false);
this.cs = commonSetup.cs;
itemRegistry = new DummyItemRegistry();
ruleRegistry = new DummyRuleRegistry();
subject.cs = commonSetup.cs;
subject.userManagement = commonSetup.userManagement;
subject.itemRegistry = itemRegistry;
subject.ruleRegistry = ruleRegistry;
subject.activate();
// Add simulated lights
addItemToReg(new SwitchItem("switch1"), OnOffType.ON, "Switchable");
addItemToReg(new ColorItem("color1"), HSBType.BLUE, "ColorLighting");
addItemToReg(new DimmerItem("white1"), new PercentType(12), "Lighting");
addItemToReg(new RollershutterItem("roller1"), new PercentType(12), "Lighting");
addItemToReg(new DimmerItem("white1"), new PercentType(12), "Lighting");
addItemToReg(new GroupItem("group1"), OnOffType.ON, "Switchable");
commonSetup.start(new ResourceConfig().registerInstances(subject));
}
use of org.openhab.io.hueemulation.internal.rest.mocks.DummyItemRegistry in project openhab-addons by openhab.
the class SensorTests method setUp.
@BeforeEach
public void setUp() throws IOException {
commonSetup = new CommonSetup(false);
itemRegistry = new DummyItemRegistry();
this.cs = commonSetup.cs;
subject.cs = cs;
subject.userManagement = commonSetup.userManagement;
subject.itemRegistry = itemRegistry;
subject.activate();
// Add simulated sensor items
addItemToReg(new SwitchItem("switch1"), OnOffType.ON, "name1");
addItemToReg(new ContactItem("contact1"), OpenClosedType.OPEN, "");
addItemToReg(new ColorItem("color1"), HSBType.BLUE, "");
addItemToReg(new DimmerItem("white1"), new PercentType(12), "");
addItemToReg(new RollershutterItem("roller1"), new PercentType(12), "");
addItemToReg(new NumberItem("number1"), new DecimalType(12), "");
commonSetup.start(new ResourceConfig().registerInstances(subject));
}
Aggregations