/** Visualization for {@link StringType} and {@link DecimalType}. {@inheritDoc} */ @Override public boolean visualizationVarStatus( ModStatusVar pchkInput, Command cmd, Item item, EventPublisher eventPublisher) { // We are actually not meant to visualize anything. // But (just in case) someone is really lazy in doing the item-definitions, we try to be helpful // by showing the // current value. if (pchkInput.getLogicalSourceAddr().equals(this.addr) && pchkInput.getVar() == this.var) { if (item.getAcceptedDataTypes().contains(StringType.class)) { String valueStr = pchkInput .getValue() .toVarUnitString( this.unit, LcnDefs.Var.isLockableRegulatorSource(this.var), LcnDefs.Var.useLcnSpecialValues(this.var)); eventPublisher.postUpdate(item.getName(), new StringType(valueStr)); return true; } else if (item.getAcceptedDataTypes().contains(DecimalType.class)) { eventPublisher.postUpdate( item.getName(), new DecimalType( pchkInput .getValue() .toVarUnit(this.unit, LcnDefs.Var.isLockableRegulatorSource(this.var)))); return true; } } return false; }
/** * Creates a new Google Calendar Entry for each <code>item</code> and adds it to the processing * queue. The entries' title will either be the items name or <code>alias</code> if it is <code> * != null</code>. * * <p>The new Calendar Entry will contain a single command to be executed e.g.<br> * * <p><code>send <item.name> <item.state></code> * * @param item the item which state should be persisted. * @param alias the alias under which the item should be persisted. */ @Override public void store(final Item item, final String alias) { if (initialized) { String newAlias = alias != null ? alias : item.getName(); CalendarEventEntry myEntry = new CalendarEventEntry(); myEntry.setTitle(new PlainTextConstruct("[PresenceSimulation] " + newAlias)); myEntry.setContent( new PlainTextConstruct( String.format(executeScript, item.getName(), item.getState().toString()))); DateTime nowPlusOffset = new DateTime().plusDays(offset); com.google.gdata.data.DateTime time = com.google.gdata.data.DateTime.parseDateTime(nowPlusOffset.toString()); When eventTimes = new When(); eventTimes.setStartTime(time); eventTimes.setEndTime(time); myEntry.addTime(eventTimes); entries.offer(myEntry); logger.trace( "added new entry '{}' for item '{}' to upload queue", myEntry.getTitle().getPlainText(), item.getName()); } else { logger.debug( "GCal PresenceSimulation Service isn't initialized properly! No entries will be uploaded to your Google Calendar"); } }
/** {@inheritDoc} */ @Override public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { logger.trace("Processing binding configuration for item {}", item.getName()); super.processBindingConfiguration(context, item, bindingConfig); SatelBindingConfig bc = this.createBindingConfig(bindingConfig); logger.trace("Adding binding configuration for item {}: {}", item.getName(), bc); addBindingConfig(item, bc); }
public List<ItemStateData> getItemStates() throws ServiceException { List<ItemStateData> itemStates = new ArrayList<ItemStateData>(); ItemRegistry itemRegistry = getItemRegistry(); for (Item item : itemRegistry.getItems()) { logger.debug("Item: " + item.getName() + " " + item.getState()); StateTransformable state = getState(item); ItemStateData itemState = new ItemStateData(System.currentTimeMillis(), item.getName(), state); itemStates.add(itemState); } return itemStates; }
@Override public void complete_ItemName( EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { super.complete_ItemName(model, ruleCall, context, acceptor); ItemRegistry itemRegistry = RuleModelUIActivator.itemRegistryTracker.getService(); for (Item item : itemRegistry.getItems()) { if (item.getName().startsWith(context.getPrefix())) { acceptor.accept(createCompletionProposal(item.getName(), context)); } } }
/** Visualization for {@link DecimalType} and {@link StringType}. {@inheritDoc} */ @Override public boolean visualizationLedsAndLogicOpsStatus( ModStatusLedsAndLogicOps pchkInput, Command cmd, Item item, EventPublisher eventPublisher) { if (pchkInput.getLogicalSourceAddr().equals(this.addr)) { if (item.getAcceptedDataTypes().contains(DecimalType.class)) { int n; switch (pchkInput.getLedState(this.ledId)) { case OFF: n = 0; break; case ON: n = 1; break; case BLINK: n = 2; break; case FLICKER: n = 3; break; default: throw new Error(); } eventPublisher.postUpdate(item.getName(), new DecimalType(n)); return true; } else if (item.getAcceptedDataTypes().contains(StringType.class)) { String s; switch (pchkInput.getLedState(this.ledId)) { case OFF: s = this.stateTexts[0]; break; case ON: s = this.stateTexts[1]; break; case BLINK: s = this.stateTexts[2]; break; case FLICKER: s = this.stateTexts[3]; break; default: throw new Error(); } eventPublisher.postUpdate(item.getName(), new StringType(s)); return true; } } return false; }
/** Constructor */ public SappBindingConfigDimmerItem(Item item, String bindingConfig) throws BindingConfigParseException { super(item.getName()); this.status = parseSappAddressStatus(bindingConfig); }
/** * Sends a command for a specified item to the event bus. * * @param item the item to send the command to * @param commandString the command to send */ public static Object sendCommand(Item item, String commandString) { if (item != null) { return sendCommand(item.getName(), commandString); } else { return null; } }
/** * Posts a status update for a specified item to the event bus. * * @param item the item to send the status update for * @param stateAsString the new state of the item */ public static Object postUpdate(Item item, String stateAsString) { if (item != null) { return postUpdate(item.getName(), stateAsString); } else { return null; } }
/** * Posts a status update for a specified item to the event bus. t * * @param item the item to send the status update for * @param state the new state of the item */ public static Object postUpdate(Item item, State state) { EventPublisher publisher = (EventPublisher) ScriptActivator.eventPublisherTracker.getService(); if (publisher != null && item != null) { publisher.postUpdate(item.getName(), state); } return null; }
/** * Sends a command for a specified item to the event bus. * * @param item the item to send the command to * @param command the command to send */ public static Object sendCommand(Item item, Command command) { EventPublisher publisher = (EventPublisher) ScriptActivator.eventPublisherTracker.getService(); if (publisher != null && item != null) { publisher.sendCommand(item.getName(), command); } return null; }
/** * Posts a status update for a specified item to the event bus. * * @param item the item to send the status update for * @param state the new state of the item as a number */ public static Object postUpdate(Item item, Number state) { if (item != null && state != null) { return postUpdate(item.getName(), state.toString()); } else { return null; } }
/** {@inheritDoc} */ @Override void handleEvent(ZWaveCommandClassValueEvent event, Item item, Map<String, String> arguments) { ZWaveStateConverter<?, ?> converter = this.getStateConverter(item, event.getValue()); if (converter == null) { logger.warn( "NODE {}: No converter found for item = {}, endpoint = {}, ignoring event.", event.getNodeId(), item.getName(), event.getEndpoint()); return; } State state = converter.convertFromValueToState(event.getValue()); this.getEventPublisher().postUpdate(item.getName(), state); }
/** {@inheritDoc} */ @Override public void receiveCommand( Item item, Command command, ZWaveNode node, ZWaveMeterCommandClass commandClass, int endpointId, Map<String, String> arguments) { // It's not an ON command from a button switch, do not reset if (command != OnOffType.ON) { return; } // get the reset message - will return null if not supported SerialMessage serialMessage = node.encapsulate(commandClass.getResetMessage(), commandClass, endpointId); if (serialMessage == null) { logger.warn( "NODE {}: Meter reset not supported for item = {}, endpoint = {}, ignoring event.", node.getNodeId(), item.getName(), endpointId); return; } // send reset message this.getController().sendData(serialMessage); // poll the device for (SerialMessage serialGetMessage : commandClass.getDynamicValues(true)) { this.getController().sendData(node.encapsulate(serialGetMessage, commandClass, endpointId)); } }
/** * Sends a number as a command for a specified item to the event bus. * * @param item the item to send the command to * @param number the number to send as a command */ public static Object sendCommand(Item item, Number number) { if (item != null && number != null) { return sendCommand(item.getName(), number.toString()); } else { return null; } }
/** * Removes existing item configurations * * @param bcl array list of binding configs to be checked * @param item item to be checked for */ private static void removeExisting(ArrayList<AlarmDecoderBindingConfig> bcl, Item item) { for (Iterator<AlarmDecoderBindingConfig> it = bcl.iterator(); it.hasNext(); ) { AlarmDecoderBindingConfig bc = it.next(); if (bc.getItemName().equals(item.getName())) { it.remove(); } } }
/** {@inheritDoc} */ @Override void receiveCommand( Item item, Command command, ZWaveNode node, ZWaveThermostatFanModeCommandClass commandClass, int endpointId, Map<String, String> arguments) { ZWaveCommandConverter<?, ?> converter = this.getCommandConverter(command.getClass()); if (converter == null) { logger.warn( "NODE {}: No converter found for item = {} endpoint = {}, ignoring command.", node.getNodeId(), item.getName(), endpointId); return; } logger.debug( "NODE {}: receiveCommand with converter {} ", node.getNodeId(), converter.getClass()); SerialMessage serialMessage = node.encapsulate( commandClass.setValueMessage( ((BigDecimal) converter.convertFromCommandToValue(item, command)).intValue()), commandClass, endpointId); logger.debug("NODE {}: receiveCommand sending message {} ", node.getNodeId(), serialMessage); if (serialMessage == null) { logger.warn( "NODE {}: Generating message failed for command class = {}, endpoint = {}", node.getNodeId(), commandClass.getCommandClass().getLabel(), endpointId); return; } this.getController().sendData(serialMessage); if (command instanceof State) this.getEventPublisher().postUpdate(item.getName(), (State) command); }
/** {@inheritDoc} */ @Override public void validateItemType(Item item, String bindingConfig) throws BindingConfigParseException { if (!(item instanceof SwitchItem || item instanceof NumberItem || item instanceof StringItem)) { throw new BindingConfigParseException( "item '" + item.getName() + "' is of type '" + item.getClass().getSimpleName() + "', only Switch-, String and NumberItems are allowed - please check your *.items configuration"); } }
/** {@inheritDoc} */ @Override public void handleEvent( ZWaveCommandClassValueEvent event, Item item, Map<String, String> arguments) { ZWaveStateConverter<?, ?> converter = this.getStateConverter(item, event.getValue()); if (converter == null) { logger.warn( "NODE {}: No converter found for item = {}, endpoint = {}, ignoring event.", event.getNodeId(), item.getName(), event.getEndpoint()); return; } // we ignore any meter reports for item bindings configured with 'meter_reset=true' // since we don't want to be updating the 'reset' switch if ("true".equalsIgnoreCase(arguments.get("meter_reset"))) { return; } String meterScale = arguments.get("meter_scale"); String meterZero = arguments.get("meter_zero"); ZWaveMeterValueEvent meterEvent = (ZWaveMeterValueEvent) event; // Don't trigger event if this item is bound to another sensor type if (meterScale != null && MeterScale.getMeterScale(meterScale) != meterEvent.getMeterScale()) { return; } Object val = event.getValue(); // If we've set a zero, then anything below this value needs to be considered ZERO if (meterZero != null) { if (((BigDecimal) val).doubleValue() <= Double.parseDouble(meterZero)) { val = BigDecimal.ZERO; } } State state = converter.convertFromValueToState(val); this.getEventPublisher().postUpdate(item.getName(), state); }
protected DigitalSTROMBindingConfig parseBindingConfigString( String context, Item item, String bindingConfig) throws BindingConfigParseException { DigitalSTROMBindingConfig configItem = new DigitalSTROMBindingConfig(); configItem.init(item, bindingConfig); if (!configItem.isValid()) { throw new BindingConfigParseException( "itemType mismatch ... wrong item:" + item.getName() + " for digitalstrom hardware"); } return configItem; }
/** Item processing for the LCN bindings. {@inheritDoc} */ @Override public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); Matcher matcher = PATTERN_BINDING_GENERAL.matcher(bindingConfig); if (!matcher.matches()) { throw new BindingConfigParseException(bindingConfig + "' contains no valid binding!"); } matcher.reset(); LcnBindingConfig bc = new LcnBindingConfig(item); while (matcher.find()) { String binding = matcher.group(1); if (binding != null && !binding.trim().isEmpty()) { String openHabCmd = null; String connId, lcnTarget; Matcher openHabMatcher = PATTERN_BINDING_WITH_OPENHAB.matcher(binding); Matcher pureMatcher = PATTERN_BINDING_PURE.matcher(binding); if (openHabMatcher.matches()) { openHabCmd = openHabMatcher.group(1); connId = openHabMatcher.group(2); lcnTarget = openHabMatcher.group(3); } else if (pureMatcher.matches()) { connId = pureMatcher.group(1); lcnTarget = pureMatcher.group(2); } else { throw new BindingConfigParseException( "Invalid binding configuration for " + binding + "!"); } String lcnShort = resolveMappings(lcnTarget, openHabCmd); if (lcnShort == null || lcnShort.equals(openHabCmd)) { lcnShort = lcnTarget; } Command cmd = openHabCmd == null ? TypeParser.parseCommand(new StringItem("").getAcceptedCommandTypes(), "") : openHabCmd.equals("%i") ? new StringType("%i") : TypeParser.parseCommand(item.getAcceptedCommandTypes(), openHabCmd); bc.add(new LcnBindingConfig.Mapping(cmd, connId, lcnShort)); } } // Finished this.addBindingConfig(item, bc); for (LcnAddrMod addr : bc.getRelatedModules()) { HashSet<String> l = this.itemNamesByModulCache.get(addr); if (l == null) { l = new HashSet<String>(); this.itemNamesByModulCache.put(addr, l); } l.add(item.getName()); } }
/** {@inheritDoc} */ @Override public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); HashMap<String, String> params = new HashMap<String, String>(); String[] parts = s_parseConfigString(item.getName(), bindingConfig, params); AlarmDecoderBindingConfig bc = null; if (parts[0].equals("SEND")) { // binding for sending commands if (!(parts.length == 2)) { throw new BindingConfigParseException("invalid SEND item config: " + bindingConfig); } bc = new AlarmDecoderBindingConfig(item, params); } else { // binding for receiving messages ADMsgType mt = ADMsgType.s_fromString(parts[0]); HashMap<String, ArrayList<AlarmDecoderBindingConfig>> addrToItemsMap = m_itemMap.get(mt.getValue()); ArrayList<AlarmDecoderBindingConfig> bcl = addrToItemsMap.get(parts[1]); if (bcl == null) { // don't have this address mapped to anything yet, start a new item list bcl = new ArrayList<AlarmDecoderBindingConfig>(); addrToItemsMap.put(parts[1], bcl); } else { // without this line a new binding configuration is entered whenever // the .items file is edited removeExisting(bcl, item); } bc = new AlarmDecoderBindingConfig(item, mt, parts[1], parts[2], params); bcl.add(bc); } addBindingConfig(item, bc); m_itemsToConfig.put(item.getName(), bc); logger.trace( "processing item \"{}\" read from .items file with cfg string {}", item.getName(), bindingConfig); }
/** {@inheritDoc} */ @Override public Item getItem(String itemName) { for (Set<Item> items : contextMap.values()) { if (items != null) { for (Item item : items) { if (itemName.equals(item.getName())) { return item; } } } } return null; }
/** * Execute refresh method. This method is called every time a binding item is refreshed and * information for the corresponding node should be looked up. * * @param item the item to refresh. * @param node the {@link ZWaveNode} that is bound to the item. * @param endpointId the endpoint id to send the message. * @param arguments the arguments for the converter. */ public void executeRefresh( Item item, ZWaveNode node, int endpointId, Map<String, String> arguments) { if (item == null) return; // not bound to an item. if (!arguments.containsKey("item")) return; ZWaveInformationItem informationItem = ZWaveInformationItem.getZWaveBindingAction(arguments.get("item")); // item not recognized. if (informationItem == null) { logger.warn("Incorrect information item specified. item name = {}", arguments.get("item")); return; } State state = UnDefType.UNDEF; // extract the appropriate information value Object value = getInformationItemValue(node, informationItem); if (value != null) { ZWaveStateConverter<?, ?> converter = this.getStateConverter(item, value); if (converter == null) { logger.warn( "No converter found for item = {}, node = {} endpoint = {}, ignoring event.", item.getName(), node.getNodeId(), endpointId); return; } state = converter.convertFromValueToState(value); } this.getEventPublisher().postUpdate(item.getName(), state); }
/** @{inheritDoc */ @Override public void validateItemType(Item item, String bindingConfig) throws BindingConfigParseException { EcoTouchTags tag; try { tag = EcoTouchTags.fromString(bindingConfig); } catch (Exception e) { throw new BindingConfigParseException( "item '" + item.getName() + "' tries to bind to '" + bindingConfig + "', which is unknown - please check your *.items configuration"); } if (!tag.getItemClass().isInstance(item)) { throw new BindingConfigParseException( "item '" + item.getName() + "' is of type '" + item.getClass().getSimpleName() + "', only " + tag.getItemClass().getSimpleName() + " are allowed - please check your *.items configuration"); } }
/** {@inheritDoc} */ @Override public void validateItemType(Item item, String bindingConfig) throws BindingConfigParseException { // TODO: should parse, then do type checking based on binding config string! if ((item instanceof NumberItem) || (item instanceof ContactItem) || (item instanceof StringItem) || (item instanceof SwitchItem)) { return; } throw new BindingConfigParseException( "item '" + item.getName() + "' is of type '" + item.getClass().getSimpleName() + "', only Number, Contact, String, or Switch item types are allowed. Check your *.items configuration"); }
/** {@inheritDoc} */ @Override public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); // primitive parsing String[] confparts = bindingConfig.trim().split(";"); int id = -1; try { id = Integer.parseInt(confparts[0]); } catch (NumberFormatException e) { logger.debug( "Could not parse the id value from the items-file in processBindingConfiguration()!"); e.printStackTrace(); } String type = confparts[1]; String ip = confparts[2]; HexaBusBindingConfig config = null; try { config = new HexaBusBindingConfig(id, type, InetAddress.getByName(ip)); } catch (UnknownHostException e) { logger.debug( "Could not parse the device ip from the items-file in processBindingConfiguration()!"); e.printStackTrace(); return; } addBindingConfig(item, config); items.put(item.getName(), item); if (config.getPlugType().equals("plug+")) { logger.debug("BindProv ip string: " + config.getIP()); pullList.add(config.getIP()); } }
/** {@inheritDoc} */ @Override public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); if (bindingConfig == null) { logger.debug("binding-configuration is currently not set for item: " + item.getName()); return; } logger.trace("handling config: {}", bindingConfig); List<String> calendar = new ArrayList<String>(); ; String type = null; Type typeEnum = null; String eventNr = null; String value = null; Value valueEnum = null; String[] splits = bindingConfig.split(" "); for (String split : splits) { logger.trace("handling config part: {}", split); Matcher mCalendar = Pattern.compile(REGEX_CALENDAR).matcher(split); if (mCalendar.matches()) { for (String str : mCalendar.group(1).split(",")) { calendar.add(str); } } Matcher mType = Pattern.compile(REGEX_TYPE).matcher(split); if (mType.matches()) { type = mType.group(1); } Matcher mEventNr = Pattern.compile(REGEX_EVENT_NR).matcher(split); if (mEventNr.matches()) { eventNr = mEventNr.group(1); } Matcher mValue = Pattern.compile(REGEX_VALUE).matcher(split); if (mValue.matches()) { value = mValue.group(1); } } logger.trace( "found values: calendar={}, type={}, eventNr={}, value={}", calendar, type, eventNr, value); if (calendar == null || calendar.size() == 0) { throw new BindingConfigParseException("missing attribute 'calendar'"); } if (type == null) { throw new BindingConfigParseException("missing attribute 'type'"); } try { typeEnum = CalDavConfig.Type.valueOf(type.toUpperCase()); } catch (IllegalArgumentException e) { throw new BindingConfigParseException("type '" + type + "' not valid"); } if (typeEnum != Type.PRESENCE) { if (eventNr == null) { throw new BindingConfigParseException("missing attribute 'eventNr'"); } if (value == null) { throw new BindingConfigParseException("missing attribute 'value'"); } if (!NumberUtils.isDigits(eventNr)) { throw new BindingConfigParseException("attribute 'eventNr' must be a valid integer"); } try { valueEnum = CalDavConfig.Value.valueOf(value.toUpperCase()); } catch (IllegalArgumentException e) { throw new BindingConfigParseException("value '" + type + "' not valid"); } } else { if (eventNr != null) { throw new BindingConfigParseException("not required attribute 'eventNr'"); } if (value != null) { throw new BindingConfigParseException("not required attribute 'value'"); } } logger.debug("adding item: {}", item.getName()); this.addBindingConfig( item, new CalDavConfig( calendar, typeEnum, NumberUtils.toInt(eventNr == null ? "0" : eventNr), valueEnum)); }
public void handleEvent(ProtocolRead p_protocol_read) throws Exception { // the events on the bus are now received // map them to events on the openhab bus logger.debug( "Gateway [" + m_gateway_id + "], Bticino WHO [" + p_protocol_read.getProperty("who") + "], WHAT [" + p_protocol_read.getProperty("what") + "], WHERE [" + p_protocol_read.getProperty("where") + "]"); // Get all the configs that are connected to this (who,where), multiple // possible List<BticinoBindingConfig> l_binding_configs = m_bticino_binding.getItemForBticinoBindingConfig( p_protocol_read.getProperty("who"), p_protocol_read.getProperty("where")); // log it when an event has occured that no item is bound to if (l_binding_configs.isEmpty()) { logger.debug( "Gateway [" + m_gateway_id + "], No Item found for bticino event, WHO [" + p_protocol_read.getProperty("who") + "], WHAT [" + p_protocol_read.getProperty("what") + "], WHERE [" + p_protocol_read.getProperty("where") + "]"); } // every item associated with this who/where update the status for (BticinoBindingConfig l_binding_config : l_binding_configs) { // Get the Item out of the config Item l_item = l_binding_config.getItem(); if (l_item instanceof SwitchItem) { // Lights if (p_protocol_read.getProperty("messageType").equalsIgnoreCase("lighting")) { logger.debug( "Gateway [" + m_gateway_id + "], RECEIVED EVENT FOR SwitchItem [" + l_item.getName() + "], TRANSLATE TO OPENHAB BUS EVENT"); if (p_protocol_read.getProperty("messageDescription").equalsIgnoreCase("Light ON")) { eventPublisher.postUpdate(l_item.getName(), OnOffType.ON); } else if (p_protocol_read .getProperty("messageDescription") .equalsIgnoreCase("Light OFF")) { eventPublisher.postUpdate(l_item.getName(), OnOffType.OFF); } } // CENs else if (p_protocol_read .getProperty("messageType") .equalsIgnoreCase("CEN Basic and Evolved")) { // Pushbutton virtual address must match if (l_binding_config.what.equalsIgnoreCase(p_protocol_read.getProperty("what"))) { logger.debug( "Gateway [" + m_gateway_id + "], RECEIVED EVENT FOR SwitchItem [" + l_item.getName() + "], TRANSLATE TO OPENHAB BUS EVENT"); if (p_protocol_read .getProperty("messageDescription") .equalsIgnoreCase("Virtual pressure")) { // only returns when finished eventPublisher.sendCommand(l_item.getName(), OnOffType.ON); } else if (p_protocol_read .getProperty("messageDescription") .equalsIgnoreCase("Virtual release after short pressure")) { // only returns when finished eventPublisher.sendCommand(l_item.getName(), OnOffType.ON); } else if (p_protocol_read .getProperty("messageDescription") .equalsIgnoreCase("Virtual release after an extended pressure")) { // only returns when finished eventPublisher.sendCommand(l_item.getName(), OnOffType.ON); } else if (p_protocol_read .getProperty("messageDescription") .equalsIgnoreCase("Virtual extended pressure")) { // only returns when finished eventPublisher.sendCommand(l_item.getName(), OnOffType.ON); } } } } else if (l_item instanceof RollershutterItem) { logger.debug( "Gateway [" + m_gateway_id + "], RECEIVED EVENT FOR RollershutterItem [" + l_item.getName() + "], TRANSLATE TO OPENHAB BUS EVENT"); if (p_protocol_read.getProperty("messageType").equalsIgnoreCase("automation")) { if (p_protocol_read.getProperty("messageDescription").equalsIgnoreCase("Automation UP")) { eventPublisher.postUpdate(l_item.getName(), UpDownType.UP); } else if (p_protocol_read .getProperty("messageDescription") .equalsIgnoreCase("Automation DOWN")) { eventPublisher.postUpdate(l_item.getName(), UpDownType.DOWN); } } } else if (l_item instanceof NumberItem) { logger.debug( "Gateway [" + m_gateway_id + "], RECEIVED EVENT FOR NumberItem [" + l_item.getName() + "], TRANSLATE TO OPENHAB BUS EVENT"); // THERMOREGULATION if (p_protocol_read.getProperty("messageType").equalsIgnoreCase("thermoregulation")) { if (p_protocol_read .getProperty("messageDescription") .equalsIgnoreCase("Temperature value")) { eventPublisher.postUpdate( l_item.getName(), DecimalType.valueOf(p_protocol_read.getProperty("temperature"))); } } } } }
/** @{inheritDoc} */ @Override public void store(Item item) { store(item, item.getName()); }