Examples of RestMcuLineNotify


Examples of org.housecream.restmcu.api.domain.line.RestMcuLineNotify

        line.getDescription().setValueMin(0f);

        line.setSettings(new RestMcuLineSettings());
        line.getSettings().setName("name of pin");
        List<RestMcuLineNotify> notifies = new ArrayList<RestMcuLineNotify>();
        notifies.add(new RestMcuLineNotify(SUP_OR_EQUAL, 42));
        notifies.add(new RestMcuLineNotify(INF_OR_EQUAL, 42));

        line.getSettings().setNotifies(notifies);

        return line;
    }
View Full Code Here

Examples of org.housecream.restmcu.api.domain.line.RestMcuLineNotify

        this.oldValue = oldValue;
        return this;
    }

    public NotifBuilder notify(RestMcuLineNotifyCondition supOrEqual, int i) {
        this.notify = new RestMcuLineNotify(supOrEqual, i);
        return this;
    }
View Full Code Here

Examples of org.housecream.restmcu.api.domain.line.RestMcuLineNotify

        RestMcuBoardSettings boardSettings = new RestMcuBoardSettings();
        boardSettings.setNotifyUrl("http://" + NetworkUtils.getFirstNonWifiIp() + ":5879/");
        restmcu.getBoardResource().setBoardSettings(boardSettings);
        RestMcuLineResource lineResource = restmcu.getLineResource();
        RestMcuLineSettings settings = new RestMcuLineSettings();
        settings.setNotifies(Arrays.asList(new RestMcuLineNotify(RestMcuLineNotifyCondition.SUP_OR_EQUAL, 1f)));
        lineResource.setLineSettings(54, settings);
        lineResource.setLineValue(9, 0f);

        lineResource.setLineValue(9, 1f);

        RestMcuLineNotification restMcuLineNotification = notifyResource.awaitLine().get(0);
        assertEquals(54, restMcuLineNotification.getLineId());
        assertEquals(new RestMcuLineNotify(RestMcuLineNotifyCondition.SUP_OR_EQUAL, 1f),
                restMcuLineNotification.getNotify());
        assertEquals(0f, restMcuLineNotification.getOldValue(), 0);
        assertEquals(1f, restMcuLineNotification.getValue(), 0);
        assertEquals(RestmcuTestContext.getUrl().substring(7, RestmcuTestContext.getUrl().length() - 1),
                restMcuLineNotification.getSource());
View Full Code Here

Examples of org.housecream.restmcu.api.domain.line.RestMcuLineNotify

    @Test
    public void should_update_notify() throws Exception {
        RestMcuLineSettings value = new RestMcuLineSettings();
        List<RestMcuLineNotify> asList = Arrays.asList(
                new RestMcuLineNotify(RestMcuLineNotifyCondition.INF_OR_EQUAL, 1f), new RestMcuLineNotify(
                        RestMcuLineNotifyCondition.SUP_OR_EQUAL, 1f));
        value.setNotifies(asList);

        restmcu.getLineResource().setLineSettings(8, value);
View Full Code Here

Examples of org.housecream.restmcu.api.domain.line.RestMcuLineNotify

    @Test
    public void should_update_notify2() throws Exception {
        RestMcuLineSettings value = new RestMcuLineSettings();
        List<RestMcuLineNotify> asList = Arrays.asList(
                new RestMcuLineNotify(RestMcuLineNotifyCondition.INF_OR_EQUAL, 0f), new RestMcuLineNotify(
                        RestMcuLineNotifyCondition.SUP_OR_EQUAL, 0f));
        value.setNotifies(asList);

        restmcu.getLineResource().setLineSettings(8, value);
View Full Code Here

Examples of org.housecream.restmcu.api.domain.line.RestMcuLineNotify

    @Test
    public void should_update_notify3() throws Exception {
        RestMcuLineSettings value = new RestMcuLineSettings();
        // its duplicated but should not be a problem for the controller as it will notify only once
        List<RestMcuLineNotify> asList = Arrays.asList(
                new RestMcuLineNotify(RestMcuLineNotifyCondition.INF_OR_EQUAL, 0f), //
                new RestMcuLineNotify(RestMcuLineNotifyCondition.SUP_OR_EQUAL, 0f), //
                new RestMcuLineNotify(RestMcuLineNotifyCondition.INF_OR_EQUAL, 0f), //
                new RestMcuLineNotify(RestMcuLineNotifyCondition.SUP_OR_EQUAL, 0f));
        value.setNotifies(asList);

        restmcu.getLineResource().setLineSettings(8, value);

        List<RestMcuLineNotify> notifies = restmcu.getLineResource().getLineSettings(8).getNotifies();
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.