Skip to content

Commit 06cfbb4

Browse files
committed
Remove webhooks
Signed-off-by: Florian Hotze <[email protected]>
1 parent a6c1f6b commit 06cfbb4

File tree

1 file changed

+2
-21
lines changed
  • bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/internal/item

1 file changed

+2
-21
lines changed

bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/internal/item/ItemResource.java

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -363,19 +363,12 @@ private Set<String> splitAndFilterNamespaces(@Nullable String namespaceSelector,
363363
@RolesAllowed({ Role.USER, Role.ADMIN })
364364
@Path("/{itemname: [a-zA-Z_0-9]+}/state")
365365
@Produces(MediaType.TEXT_PLAIN)
366-
@Operation(operationId = "getOrSetItemState", summary = "Gets or sets the state of an item.", responses = {
366+
@Operation(operationId = "getOrSetItemState", summary = "Gets the state of an item.", responses = {
367367
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = String.class))),
368-
@ApiResponse(responseCode = "202", description = "State accepted"),
369-
@ApiResponse(responseCode = "400", description = "State cannot be parsed"),
370368
@ApiResponse(responseCode = "404", description = "Item not found") })
371369
public Response getPlainItemState(
372370
@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
373-
@PathParam("itemname") @Parameter(description = "item name") String itemname,
374-
@QueryParam("state") @Parameter(description = "valid item state (e.g. ON, OFF) to set", required = false) @Nullable String state) {
375-
if (state != null) {
376-
return sendItemStateInternal(language, itemname, state);
377-
}
378-
371+
@PathParam("itemname") @Parameter(description = "item name") String itemname) {
379372
// get item
380373
Item item = getItem(itemname);
381374

@@ -505,18 +498,6 @@ public Response postItemCommandJson(@PathParam("itemname") String itemname, Valu
505498
return sendItemCommandInternal(itemname, valueContainer.value());
506499
}
507500

508-
@GET
509-
@RolesAllowed({ Role.USER, Role.ADMIN })
510-
@Path("/{itemname: [a-zA-Z_0-9]+}/command")
511-
@Operation(operationId = "sendItemCommandWebhook", summary = "Sends a command to an item.", description = "Allows to send a command to an item using webhooks.", responses = {
512-
@ApiResponse(responseCode = "200", description = "OK"),
513-
@ApiResponse(responseCode = "404", description = "Item not found"),
514-
@ApiResponse(responseCode = "400", description = "Command cannot be parsed") })
515-
public Response itemCommandWebhook(@PathParam("itemname") @Parameter(description = "item name") String itemname,
516-
@QueryParam("command") @Parameter(description = "valid item command (e.g. ON, OFF, UP, DOWN, REFRESH)", required = true) String value) {
517-
return sendItemCommandInternal(itemname, value);
518-
}
519-
520501
private Response sendItemCommandInternal(String itemname, String value) {
521502
Item item = getItem(itemname);
522503
Command command = null;

0 commit comments

Comments
 (0)