@Override protected void initUnitLabel() { String unitLabel = Constants.UNKNOWN_ID; try { unitLabel = this.appRemote.getData().getLabel(); } catch (CouldNotPerformException e) { ExceptionPrinter.printHistory(e, LOGGER, LogLevel.ERROR); } setUnitLabelString(unitLabel); }
private void initEffect() { State state = State.UNKNOWN; try { state = appRemote.getData().getActivationState().getValue(); } catch (CouldNotPerformException e) { ExceptionPrinter.printHistory(e, LOGGER, LogLevel.ERROR); } setAppIconAndText(state); }
private void sendStateToRemote(final State state) { try { appRemote .setActivationState(ActivationState.newBuilder().setValue(state).build()) .get(Constants.OPERATION_SERVICE_MILLI_TIMEOUT, TimeUnit.MILLISECONDS); } catch (InterruptedException | ExecutionException | TimeoutException | CouldNotPerformException ex) { ExceptionPrinter.printHistory(ex, LOGGER, LogLevel.ERROR); setWidgetPaneDisable(true); } }