Package it.freedomotic.events

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


        c.setProperty("seven", "= seven=\"Current temperature is @event.temperature celsius degrees. In fahrenheit is \" + Math.floor(((@event.temperature+40)*1.8)-40) + \" degrees.\";");
        c.setProperty("eight", "= eight=10+5;"); //this always returns a double
        c.setProperty("nine", "= nine=Math.floor(10+5).toString();"); //print the number as is to avoid conversion to double
        //c.setProperty("ten", "= if (@event.temperature<= 20) ten=2; else what=@event.temperature/10;");
        GenericEvent event = new GenericEvent(this);
        event.addProperty("zone", "Kitchen");
        event.addProperty("temperature", "25");
        event.addProperty("object.name", "Indoor Thermometer");
        Resolver resolver = new Resolver();
        resolver.addContext("event.", event.getPayload());
        Command result = new Command();
View Full Code Here


        c.setProperty("eight", "= eight=10+5;"); //this always returns a double
        c.setProperty("nine", "= nine=Math.floor(10+5).toString();"); //print the number as is to avoid conversion to double
        //c.setProperty("ten", "= if (@event.temperature<= 20) ten=2; else what=@event.temperature/10;");
        GenericEvent event = new GenericEvent(this);
        event.addProperty("zone", "Kitchen");
        event.addProperty("temperature", "25");
        event.addProperty("object.name", "Indoor Thermometer");
        Resolver resolver = new Resolver();
        resolver.addContext("event.", event.getPayload());
        Command result = new Command();
        try {
View Full Code Here

        c.setProperty("nine", "= nine=Math.floor(10+5).toString();"); //print the number as is to avoid conversion to double
        //c.setProperty("ten", "= if (@event.temperature<= 20) ten=2; else what=@event.temperature/10;");
        GenericEvent event = new GenericEvent(this);
        event.addProperty("zone", "Kitchen");
        event.addProperty("temperature", "25");
        event.addProperty("object.name", "Indoor Thermometer");
        Resolver resolver = new Resolver();
        resolver.addContext("event.", event.getPayload());
        Command result = new Command();
        try {
            result = resolver.resolve(c);
View Full Code Here

        c.getPayload().addStatement("seven", "= seven=\"Current temperature is @event.temperature celsius degrees. In fahrenheit is \" + Math.floor(((@event.temperature+40)*1.8)-40) + \" degrees.\";");
        c.getPayload().addStatement("eight", "= eight=10+5;"); //this always returns a double
        c.getPayload().addStatement("nine", "= nine=Math.floor(10+5).toString();"); //print the number as is to avoid conversion to double
        c.getPayload().addStatement("SET", "behaviorValue", "EQUALS", "= if (@event.temperature > 20) behaviorValue=\"it's hot\"; else behaviorValue=\"it's cold\";");
        GenericEvent event = new GenericEvent(this);
        event.addProperty("zone", "Kitchen");
        event.addProperty("temperature", "25");
        event.addProperty("object.name", "Indoor Thermometer");
        Resolver resolver = new Resolver();
        resolver.addContext("event.", event.getPayload());
        Trigger result = null;
View Full Code Here

        c.getPayload().addStatement("eight", "= eight=10+5;"); //this always returns a double
        c.getPayload().addStatement("nine", "= nine=Math.floor(10+5).toString();"); //print the number as is to avoid conversion to double
        c.getPayload().addStatement("SET", "behaviorValue", "EQUALS", "= if (@event.temperature > 20) behaviorValue=\"it's hot\"; else behaviorValue=\"it's cold\";");
        GenericEvent event = new GenericEvent(this);
        event.addProperty("zone", "Kitchen");
        event.addProperty("temperature", "25");
        event.addProperty("object.name", "Indoor Thermometer");
        Resolver resolver = new Resolver();
        resolver.addContext("event.", event.getPayload());
        Trigger result = null;
        try {
View Full Code Here

        c.getPayload().addStatement("nine", "= nine=Math.floor(10+5).toString();"); //print the number as is to avoid conversion to double
        c.getPayload().addStatement("SET", "behaviorValue", "EQUALS", "= if (@event.temperature > 20) behaviorValue=\"it's hot\"; else behaviorValue=\"it's cold\";");
        GenericEvent event = new GenericEvent(this);
        event.addProperty("zone", "Kitchen");
        event.addProperty("temperature", "25");
        event.addProperty("object.name", "Indoor Thermometer");
        Resolver resolver = new Resolver();
        resolver.addContext("event.", event.getPayload());
        Trigger result = null;
        try {
            result = resolver.resolve(c);
View Full Code Here

        ev.setDestination("app.event.sensor.calendar.event.twilight");
       

        if (toSunset.getMillis() < POLLING_WAIT / 2) {
            // it's sunset
            ev.addProperty("isSunset", "true");
        } else if (toSunrise.getMillis() < POLLING_WAIT / 2) {
            // it's sunrise
            ev.addProperty("isSunrise", "true");
        }
        if (ref.isBefore(sunriseTime)) {
View Full Code Here

        if (toSunset.getMillis() < POLLING_WAIT / 2) {
            // it's sunset
            ev.addProperty("isSunset", "true");
        } else if (toSunrise.getMillis() < POLLING_WAIT / 2) {
            // it's sunrise
            ev.addProperty("isSunrise", "true");
        }
        if (ref.isBefore(sunriseTime)) {
            // prima dell'alba
            ev.addProperty("beforeSunrise", Long.toString(toSunrise.getStandardMinutes()));
        } else if (ref.isAfter(sunriseTime)) {
View Full Code Here

            // it's sunrise
            ev.addProperty("isSunrise", "true");
        }
        if (ref.isBefore(sunriseTime)) {
            // prima dell'alba
            ev.addProperty("beforeSunrise", Long.toString(toSunrise.getStandardMinutes()));
        } else if (ref.isAfter(sunriseTime)) {
            // dopo l'alba,
            ev.addProperty("afterSunrise", Long.toString(toSunrise.getStandardMinutes()));
        }
       
View Full Code Here

        if (ref.isBefore(sunriseTime)) {
            // prima dell'alba
            ev.addProperty("beforeSunrise", Long.toString(toSunrise.getStandardMinutes()));
        } else if (ref.isAfter(sunriseTime)) {
            // dopo l'alba,
            ev.addProperty("afterSunrise", Long.toString(toSunrise.getStandardMinutes()));
        }
       
        if (ref.isBefore(sunsetTime)) {
            // prima del tramonto
            ev.addProperty("beforeSunset", Long.toString(toSunset.getStandardMinutes()));
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.