@@ -363,19 +363,12 @@ private Set<String> splitAndFilterNamespaces(@Nullable String namespaceSelector,
363
363
@ RolesAllowed ({ Role .USER , Role .ADMIN })
364
364
@ Path ("/{itemname: [a-zA-Z_0-9]+}/state" )
365
365
@ 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 = {
367
367
@ 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" ),
370
368
@ ApiResponse (responseCode = "404" , description = "Item not found" ) })
371
369
public Response getPlainItemState (
372
370
@ 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 ) {
379
372
// get item
380
373
Item item = getItem (itemname );
381
374
@@ -505,18 +498,6 @@ public Response postItemCommandJson(@PathParam("itemname") String itemname, Valu
505
498
return sendItemCommandInternal (itemname , valueContainer .value ());
506
499
}
507
500
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
-
520
501
private Response sendItemCommandInternal (String itemname , String value ) {
521
502
Item item = getItem (itemname );
522
503
Command command = null ;
0 commit comments