Package org.housecream.restmcu.api.domain.line

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


        notifyChange(lineId, oldValue);
    }

    private void notifyChange(Integer lineId, Float oldValue) {
        String source = boardResource.getBoardSettings().getIp() + ":" + boardResource.getBoardSettings().getPort();
        RestMcuLineNotification notif = notif().lineId(lineId).oldVal(oldValue).val(lineInfo(lineId).getValue())
                .build();
        notif.setSource(source);
        boardResource.sendNotif(notif);
    }
View Full Code Here


        notifBuilder.line(lineInfo);
        return notifBuilder;
    }

    public RestMcuLineNotification build() {
        RestMcuLineNotification pinNotif = new RestMcuLineNotification();
        if (lineId == null) {
            pinNotif.setLineId(lineInfo.getLineId());
            pinNotif.setOldValue(lineInfo.getValue());
        } else {
            pinNotif.setLineId(lineId);
            pinNotif.setOldValue(oldValue);
        }
        pinNotif.setValue(value);
        pinNotif.setNotify(notify);
        return pinNotif;
    }
View Full Code Here

        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

TOP

Related Classes of org.housecream.restmcu.api.domain.line.RestMcuLineNotification

Copyright © 2018 www.massapicom. 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.