public static OpenhabCommandType.OpenhabCommand.Builder newOnOffCommand(final PowerState.State state) throws CouldNotPerformException { return newOnOffCommand(PowerStateTransformer.transform(state)); }
public static OpenhabCommandType.OpenhabCommand.Builder newUpDownCommand(final BlindState state) throws CouldNotPerformException { return newUpDownCommand(UpDownStateTransformer.transform(state)); }
public static OpenhabCommandType.OpenhabCommand.Builder newStopMoveCommand(final BlindState state) throws CouldNotPerformException { return newStopMoveCommand(StopMoveStateTransformer.transform(state)); }
switch (serviceType) { case POWER_CONSUMPTION_STATE_SERVICE: msg = PowerConsumptionStateTransformer.transform(command.getDecimal()); break; case MOTION_STATE_SERVICE: msg = MotionStateTransformer.transform(command.getDecimal()); break; case TAMPER_STATE_SERVICE: msg = TamperStateTransformer.transform(command.getDecimal()); break; case BATTERY_STATE_SERVICE: msg = BatteryStateTransformer.transform(command.getDecimal()); break; case TEMPERATURE_ALARM_STATE_SERVICE: case SMOKE_ALARM_STATE_SERVICE: msg = AlarmStateTransformer.transform(command.getDecimal()); break; case SMOKE_STATE_SERVICE: msg = SmokeStateTransformer.transform(command.getDecimal()); break; case TEMPERATURE_STATE_SERVICE: case TARGET_TEMPERATURE_STATE_SERVICE: msg = TemperatureStateTransformer.transform(command.getDecimal()); break; case BRIGHTNESS_STATE_SERVICE: msg = BrightnessStateTransformer.transform(command.getDecimal()); break; case ILLUMINANCE_STATE_SERVICE: msg = IlluminanceStateTransformer.transform(command.getDecimal());
public static OpenhabCommandType.OpenhabCommand.Builder newHSBCommand(final HSBColor color) throws CouldNotPerformException { return newHSBCommand(HSBColorTransformer.transform(color)); }
public void receiveUpdate(OpenhabCommandType.OpenhabCommand command) throws CouldNotPerformException { LOGGER.info("receiveUpdate [" + command.getItem() + "=" + command.getType() + "]"); OpenhabCommandMetaData metaData = new OpenhabCommandMetaData(command); Object serviceData = OpenhabCommandTransformer.getServiceData(command, metaData.getServiceType()); if (serviceData == null) { return; } final UnitController unitController; try { unitController = unitControllerRegistry.getUnitByScope(metaData.getUnitScope()); } catch (NotAvailableException ex) { if (!unitControllerRegistry.isInitiallySynchronized()) { LOGGER.debug("ItemUpdate[" + command.getItem() + "=" + command.getType() + "] skipped because controller registry was not ready yet!"); return; } throw ex; } unitController.applyDataUpdate(serviceData, metaData.getServiceType()); } }
@Override public void internalReceiveUpdate(final OpenhabCommand command) throws CouldNotPerformException { try { //Ignore commands that are not for the device manager but for example for the scene registry if (!command.getItemBindingConfig().isEmpty() || command.getItem().startsWith("Location")) { logger.debug("Ignoring item [" + command.getItem() + "] because itemBindingConfig [" + command.getItemBindingConfig() + "] is not empty"); return; } commandExecutor.receiveUpdate(command); } catch (Exception ex) { throw new CouldNotPerformException("Skip item update [" + command.getItem() + " = " + OpenhabCommandTransformer.getCommandData(command) + "]!", ex); } }
public static OpenhabCommandType.OpenhabCommand.Builder newOnOffCommand(final PowerState.State state) throws CouldNotPerformException { return newOnOffCommand(PowerStateTransformer.transform(state)); }
public static OpenhabCommandType.OpenhabCommand.Builder newUpDownCommand(final BlindState state) throws CouldNotPerformException { return newUpDownCommand(UpDownStateTransformer.transform(state)); }
public static OpenhabCommandType.OpenhabCommand.Builder newStopMoveCommand(final BlindState state) throws CouldNotPerformException { return newStopMoveCommand(StopMoveStateTransformer.transform(state)); }
public static OpenhabCommandType.OpenhabCommand.Builder newHSBCommand(final HSBColor color) throws CouldNotPerformException { return newHSBCommand(HSBColorTransformer.transform(color)); }
ServiceType serviceType = getServiceTypeForCommand(command); String methodName = "set" + StringProcessor.transformUpperCaseToCamelCase(serviceType.name()).replaceAll("Provider", "").replaceAll("Service", ""); Object serviceData = OpenhabCommandTransformer.getServiceData(command, serviceType);