Examples of ZWaveBinarySensorValueEvent


Examples of org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveBinarySensorCommandClass.ZWaveBinarySensorValueEvent

   */
  @Override
  public void handleEvent(ZWaveCommandClassValueEvent event, Item item, Map<String,String> arguments) {
    ZWaveStateConverter<?,?> converter = this.getStateConverter(item, event.getValue());
    String sensorType = arguments.get("sensor_type");
    ZWaveBinarySensorValueEvent sensorEvent = (ZWaveBinarySensorValueEvent)event;

    if (converter == null) {
      logger.warn("No converter found for item = {}, node = {} endpoint = {}, ignoring event.", item.getName(), event.getNodeId(), event.getEndpoint());
      return;
    }
   
    // Don't trigger event if this item is bound to another sensor type
    if (sensorType != null && SensorType.getSensorType(Integer.parseInt(sensorType)) != sensorEvent.getSensorType())
      return;
   
    State state = converter.convertFromValueToState(event.getValue());
    this.getEventPublisher().postUpdate(item.getName(), state);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.