unfoldedcircle / integration-node-library

NodeJS API wrapper for the Unfolded Circle Integration API
Apache License 2.0
0 stars 3 forks source link

subscribe_events returns error code for already subscribed entities #2

Closed zehnm closed 1 year ago

zehnm commented 1 year ago

A subscribe_events request will be sent after the connection is authenticated, or if an available entity gets configured in the remote. It can also be sent multiple times.

The status code logic may therefore not be based if the entity is already configured or not:

[UC Integration API] Incoming: {"kind":"req","id":8,"msg":"subscribe_events","msg_data":{"entity_ids":["my_unique_light_id"]}}
ENTITIES(configured): Entity is already in storage: my_unique_light_id
ENTITIES(configured): Config saved to file: configured.json
Subsribed entity: "my_unique_light_id"
[UC Integration API] Sending response: {"kind":"resp","req_id":8,"code":404,"msg":"result","msg_data":null}

Detail: typo in Subsribed ;-)