unfoldedcircle / core-api

API specifications for Remote Two by Unfolded Circle
Creative Commons Attribution Share Alike 4.0 International
70 stars 1 forks source link

Remote entities cannot update options with simple commands #51

Closed dgrothman closed 2 months ago

dgrothman commented 2 months ago

Description

When creating an entity via the node api it gets created without any simple commands in the options, if I try and use the api to do a patch to the entity it responds with a 200 success but doesn't actually add the simple commands to the options

How to Reproduce

Steps to reproduce the behavior:

  1. ... create entity of type remote without simple commands in the options
  2. ... try and run a patch to add simple commands to the options
  3. ... getEntity and see that the simple commands are still not there

Expected behavior

To have the simple_commands added to the options

Screenshots

Your Environment

Additional context

Here is the json i am sending: { "options": { "simple_commands": ["CURSOR_UP", "CURSOR_DOWN", "CURSOR_LEFT", "CURSOR_RIGHT", "OK", "BACK", "MENU", "EXIT", "INFO", "RED", "GREEN", "YELLOW", "BLUE"] } } PATCH to {{SERVER}}/api/entities/:entityId

zehnm commented 2 months ago

Simple commands cannot be edited with the PATCH /entities/:entityId endpoint. This only allows to change name, icon and description. See documentation & EntityUpdateRequest object: https://github.com/unfoldedcircle/core-api/blob/fbf50d34cefa4e4bcbeb1e3cbe6fe80c1d705c74/core-api/rest/UCR-core-openapi.yaml#L2456-L2486

https://github.com/unfoldedcircle/core-api/blob/fbf50d34cefa4e4bcbeb1e3cbe6fe80c1d705c74/core-api/rest/UCR-core-openapi.yaml#L12354-L12367

The simple commands are provided by the corresponding integration and cannot be changed with the Core-API. Since you mentioned the node api (I assume you mean the Node.js API wrapper library), the commands have to be changed in the entities of your integration driver. The options in the Remote's entities are synchronized when the available entities are reloaded in the corresponding integration in the web-configurator.