code: protected CompletionStage<Optional<Boolean>> mode(@SuppressWarnings("unused") ServiceRequestContext ctx,
                                                        HttpRequest req) {
          return req.aggregate()
                    .thenApply(AggregatedHttpMessage::content)
                    .thenApply(HttpData::toStringAscii)
                    .thenApply(content -> {
                        switch (Ascii.toUpperCase(content)) {
                            case "ON":
                                return Optional.of(true);
                            case "OFF":
                                return Optional.of(false);
                            default:
                                return Optional.empty();
                        }
                    });
      }
docs: Judge the turning mode.
  True means turn on, False is turn off.
  If not present, Not supported.
  Default implementation is check content is on/off for PUT method
  
  @param req HttpRequest