Package it.freedomotic.events

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


        //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


            } else {
                event.addProperty("isOn", "true");
            }
        } else if (typeLine.equals("IA")) {
            if (status.equals("0")) {
                event.addProperty("isOn", "false");
                event.addProperty("valueLine", status);
            } else {
                event.addProperty("isOn", "true");
                event.addProperty("valueLine", status);
            }
View Full Code Here

                event.addProperty("isOn", "true");
            }
        } else if (typeLine.equals("IA")) {
            if (status.equals("0")) {
                event.addProperty("isOn", "false");
                event.addProperty("valueLine", status);
            } else {
                event.addProperty("isOn", "true");
                event.addProperty("valueLine", status);
            }
        }
View Full Code Here

        } else if (typeLine.equals("IA")) {
            if (status.equals("0")) {
                event.addProperty("isOn", "false");
                event.addProperty("valueLine", status);
            } else {
                event.addProperty("isOn", "true");
                event.addProperty("valueLine", status);
            }
        }

        //others additional optional info
View Full Code Here

            if (status.equals("0")) {
                event.addProperty("isOn", "false");
                event.addProperty("valueLine", status);
            } else {
                event.addProperty("isOn", "true");
                event.addProperty("valueLine", status);
            }
        }

        //others additional optional info
        //event.addProperty("status", status);
View Full Code Here

        Freedomotic.logger.log(Level.INFO, "Sending I2C protocol read event for object address ''{0}''. It''s readed status is {1}", new Object[]{device_address, val});
        //building the event
        ProtocolRead event = new ProtocolRead(this, "i2c", device_address); //IP:PORT:RELAYLINE

        if (val == 1) {
            event.addProperty("isOn", "true");
        } else {
            event.addProperty("isOn", "false");
        }

        //adding some optional information to the event
View Full Code Here

        ProtocolRead event = new ProtocolRead(this, "i2c", device_address); //IP:PORT:RELAYLINE

        if (val == 1) {
            event.addProperty("isOn", "true");
        } else {
            event.addProperty("isOn", "false");
        }

        //adding some optional information to the event
        //event.addProperty("boardIP", board.getIpAddress());
        //event.addProperty("boardPort", new Integer(board.getPort()).toString());
View Full Code Here

                //Freedomotic.logger.info(mac_address);
                //Freedomotic.logger.info(name);
                if (html.contains(mac_address.toLowerCase())) {
                    // user exist
                    event = new ProtocolRead(this, "wifi_id", mac_address);
                    event.addProperty("wifi_id.present", "true");
                    Freedomotic.sendEvent(event);
                } else {
                    // user not exist
                    event = new ProtocolRead(this, "wifi_id", mac_address);
                    event.addProperty("wifi_id.present", "false");
View Full Code Here

                    event.addProperty("wifi_id.present", "true");
                    Freedomotic.sendEvent(event);
                } else {
                    // user not exist
                    event = new ProtocolRead(this, "wifi_id", mac_address);
                    event.addProperty("wifi_id.present", "false");
                    Freedomotic.sendEvent(event);
                }
            }
            is.close();
View Full Code Here

        }
    }

    private void sendEvent(String objectAddress, String eventProperty, String eventValue) {
        ProtocolRead event = new ProtocolRead(this, PROTOCOL_NAME, objectAddress);
        event.addProperty(eventProperty, eventValue);
        //publish the event on the messaging bus
        this.notifyEvent(event);
    }

    /**
 
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.