Package it.freedomotic.events

Examples of it.freedomotic.events.ProtocolRead.addProperty()


                            for (DeviceOneWire device : portAdapter.devicesOneWire) {
                                if (device.getChanged()) {
                                    //building the event
                                    ProtocolRead event = new ProtocolRead(this, "onewire", portAdapter.getAdapterName() + ":" + portAdapter.getPortName() + ":" + device.getAddress());
                                    //adding some optional information to the event
                                    event.addProperty("sensor.unit", "C");
                                    event.addProperty("sensor.value", Double.toString(device.getValue()));
                                    event.addProperty("sensor.name", "");
                                    event.addProperty("sensor.state", "Alarm");
                                    Freedomotic.logger.warning("Object " + device.getAddress() + " is change. New Value " + Double.toString(device.getValue()));
                                    this.notifyEvent(event);
View Full Code Here


                    }
                    if (current != null) {
                        event.addProperty("current", current);
                    }
                    if (power != null) {
                        event.addProperty("power", power);
                    }
                    if (energy != null) {
                        event.addProperty("energy", energy);
                    }
                }
View Full Code Here

                                if (device.getChanged()) {
                                    //building the event
                                    ProtocolRead event = new ProtocolRead(this, "onewire", portAdapter.getAdapterName() + ":" + portAdapter.getPortName() + ":" + device.getAddress());
                                    //adding some optional information to the event
                                    event.addProperty("sensor.unit", "C");
                                    event.addProperty("sensor.value", Double.toString(device.getValue()));
                                    event.addProperty("sensor.name", "");
                                    event.addProperty("sensor.state", "Alarm");
                                    Freedomotic.logger.warning("Object " + device.getAddress() + " is change. New Value " + Double.toString(device.getValue()));
                                    this.notifyEvent(event);
                                    device.setChanged(false);
View Full Code Here

                                    //building the event
                                    ProtocolRead event = new ProtocolRead(this, "onewire", portAdapter.getAdapterName() + ":" + portAdapter.getPortName() + ":" + device.getAddress());
                                    //adding some optional information to the event
                                    event.addProperty("sensor.unit", "C");
                                    event.addProperty("sensor.value", Double.toString(device.getValue()));
                                    event.addProperty("sensor.name", "");
                                    event.addProperty("sensor.state", "Alarm");
                                    Freedomotic.logger.warning("Object " + device.getAddress() + " is change. New Value " + Double.toString(device.getValue()));
                                    this.notifyEvent(event);
                                    device.setChanged(false);
                                }
View Full Code Here

                    }
                    if (power != null) {
                        event.addProperty("power", power);
                    }
                    if (energy != null) {
                        event.addProperty("energy", energy);
                    }
                }
                if (frameParts[3].equalsIgnoreCase("1")) {
                    voltage = frameParts[3];
                    if (voltage != null) {
View Full Code Here

                                    ProtocolRead event = new ProtocolRead(this, "onewire", portAdapter.getAdapterName() + ":" + portAdapter.getPortName() + ":" + device.getAddress());
                                    //adding some optional information to the event
                                    event.addProperty("sensor.unit", "C");
                                    event.addProperty("sensor.value", Double.toString(device.getValue()));
                                    event.addProperty("sensor.name", "");
                                    event.addProperty("sensor.state", "Alarm");
                                    Freedomotic.logger.warning("Object " + device.getAddress() + " is change. New Value " + Double.toString(device.getValue()));
                                    this.notifyEvent(event);
                                    device.setChanged(false);
                                }
                            }
View Full Code Here

                    }
                }
                if (frameParts[3].equalsIgnoreCase("1")) {
                    voltage = frameParts[3];
                    if (voltage != null) {
                        event.addProperty("voltage", voltage);
                    }
                    messageDescription = "Voltage status";
                }
                if (frameParts[3].equalsIgnoreCase("2")) {
                    current = frameParts[3];
View Full Code Here

                    messageDescription = "Voltage status";
                }
                if (frameParts[3].equalsIgnoreCase("2")) {
                    current = frameParts[3];
                    if (current != null) {
                        event.addProperty("current", current);
                    }
                    messageDescription = "Current status";
                }
                if (frameParts[3].equalsIgnoreCase("3")) {
                    power = frameParts[3];
View Full Code Here

        //Freedomotic.logger.severe("k8055 address " + address);
        //add a property that defines the status readed from hardware
        //event.addProperty("relay.number", new Integer(relayLine).toString());
        if (typeLine.equals("ID")) {
            if (status.equals("0")) {
                event.addProperty("isOn", "false");
            } else {
                event.addProperty("isOn", "true");
            }
        } else if (typeLine.equals("IA")) {
            if (status.equals("0")) {
View Full Code Here

        //event.addProperty("relay.number", new Integer(relayLine).toString());
        if (typeLine.equals("ID")) {
            if (status.equals("0")) {
                event.addProperty("isOn", "false");
            } else {
                event.addProperty("isOn", "true");
            }
        } else if (typeLine.equals("IA")) {
            if (status.equals("0")) {
                event.addProperty("isOn", "false");
                event.addProperty("valueLine", status);
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.