private void activate(ThermostatPattern device) { // do not activate value resources, since they do not contain sensible values yet ResourceUtils.activateComplexResources(device.model, true, appManager.getResourceAccess()); device.model.valve().setting().controllable().setValue(false); // valve is not directly controllable, only via temp setting device.model.valve().setting().controllable().activate(false); }
ResourceUtils.activateComplexResources(threeStateDevice, true, appManager.getResourceAccess());
private void addMandatoryChannels() { HM_hlConfig attributeConfig = new HM_hlConfig(); attributeConfig.driverId = hm_hlConfig.driverId; attributeConfig.interfaceId = hm_hlConfig.interfaceId; attributeConfig.deviceAddress = hm_hlConfig.deviceAddress; attributeConfig.channelAddress = "ATTRIBUTE:0001"; attributeConfig.timeout = -1; attributeConfig.resourceName = hm_hlConfig.resourceName + "SmokeDetector"; attributeConfig.chLocator = addChannel(attributeConfig); attributeConfig = new HM_hlConfig(); attributeConfig.driverId = hm_hlConfig.driverId; attributeConfig.interfaceId = hm_hlConfig.interfaceId; attributeConfig.deviceAddress = hm_hlConfig.deviceAddress; attributeConfig.channelAddress = "ATTRIBUTE:0002"; attributeConfig.timeout = -1; attributeConfig.resourceName = hm_hlConfig.resourceName + "_BatteryStatus"; attributeConfig.chLocator = addChannel(attributeConfig); SmokeDetector smokeDetector = resourceManager.createResource(hm_hlConfig.resourceName, SmokeDetector.class); smokeAlert = smokeDetector.reading().create(); // smokeAlert.activate(true); // smokeAlert.setValue(false); smokeAlert.requestAccessMode(AccessMode.EXCLUSIVE, AccessPriority.PRIO_HIGHEST); StateOfChargeSensor eSens = smokeDetector.battery().chargeSensor().create(); batteryStatus = eSens.reading().create(); // batteryStatus.activate(true); // batteryStatus.setValue(95); batteryStatus.requestAccessMode(AccessMode.EXCLUSIVE, AccessPriority.PRIO_HIGHEST); // do not activate value resources, since they do not contain sensible values yet ResourceUtils.activateComplexResources(smokeDetector, true, appManager.getResourceAccess()); }
private void addMandatoryChannels() { HM_hlConfig attributeConfig = new HM_hlConfig(); attributeConfig.driverId = hm_hlConfig.driverId; attributeConfig.interfaceId = hm_hlConfig.interfaceId; attributeConfig.deviceAddress = hm_hlConfig.deviceAddress; attributeConfig.channelAddress = "ATTRIBUTE:0001"; attributeConfig.timeout = -1; attributeConfig.resourceName = hm_hlConfig.resourceName + "_HighWater"; attributeConfig.chLocator = addChannel(attributeConfig); attributeConfig = new HM_hlConfig(); attributeConfig.driverId = hm_hlConfig.driverId; attributeConfig.interfaceId = hm_hlConfig.interfaceId; attributeConfig.deviceAddress = hm_hlConfig.deviceAddress; attributeConfig.channelAddress = "ATTRIBUTE:0002"; attributeConfig.timeout = -1; attributeConfig.resourceName = hm_hlConfig.resourceName + "_BatteryStatus"; attributeConfig.chLocator = addChannel(attributeConfig); WaterDetector threeStateDevice = resourceManager.createResource(hm_hlConfig.resourceName, WaterDetector.class); highWater = threeStateDevice.reading().create(); // highWater.activate(true); // highWater.setValue("dry"); highWater.requestAccessMode(AccessMode.EXCLUSIVE, AccessPriority.PRIO_HIGHEST); StateOfChargeSensor eSens = threeStateDevice.battery().chargeSensor().create(); batteryStatus = eSens.reading().create(); // batteryStatus.activate(true); // batteryStatus.setValue(95); batteryStatus.requestAccessMode(AccessMode.EXCLUSIVE, AccessPriority.PRIO_HIGHEST); // do not activate value resources, since they do not contain sensible values yet ResourceUtils.activateComplexResources(threeStateDevice, true, appManager.getResourceAccess()); }
ResourceUtils.activateComplexResources(thDevice, true, appManager.getResourceAccess());
ResourceUtils.activateComplexResources(powerMeter, true, appManager.getResourceAccess()); onOff.activate(true);
ResourceUtils.activateComplexResources(motionDetector, true, appManager.getResourceAccess());
ResourceUtils.activateComplexResources(powerMeter, true, appManager.getResourceAccess()); onOff.activate(true);