@Override public boolean isTicked(long now) { if (hasReadingInterval() && now >= lastRequestTS + frequency) { this.lastRequestTS = now; return true; } return false; }
@Override public boolean setProperty(WidgetProperty property, String propertyValue) { switch (property) { case VALUE_FORMATTING : this.valueFormatting = propertyValue; return true; default: return super.setProperty(property, propertyValue); } }
@Override public void writeReadingCommand(Channel channel) { if (isNotValid()) { return; } StringMessage msg = makeUTF8StringMessage(HARDWARE, READING_MSG_ID, DataStream.makeReadingHardwareBody(pinType.pintTypeChar, pin)); channel.write(msg, channel.voidPromise()); }
@Override public boolean setProperty(WidgetProperty property, String propertyValue) { switch (property) { case VALUE_FORMATTING : this.valueFormatting = propertyValue; return true; default: return super.setProperty(property, propertyValue); } }