ioBroker / ioBroker.simple-api

HTTP-API Interface to read and write objets and states
MIT License
40 stars 19 forks source link

Add get/setBinaryState #111

Open klein0r opened 2 years ago

klein0r commented 2 years ago

Describe the bug

I'm not able to get binary information of states

To Reproduce

  1. Create a state with type file
  2. Use setBinaryState to store binary information (like an image)
  3. Call http://ip:8087/getPlainValue/your.state.id
  4. See error error: datapoint "[object Object]" not found

Expected behavior

Return the binary information of state

Versions:

klein0r commented 2 years ago

Additional issue:

https://github.com/ioBroker/ioBroker.simple-api/blob/e74ee7040565e8d0597d2f5bce014f2322c5d7ac/lib/simpleapi.js#L831

originId contains my translated name object:

{"en":"Thumbnail","de":"Miniaturansicht","ru":"Миниатюра","pt":"Miniatura","nl":"Miniatuur","fr":"La vignette","it":"Miniatura","es":"Miniatura","pl":"Miniaturka","zh-cn":"缩略图"}

So... error: datapoint "[object Object]" not found is not true. It was found.

Apollon77 commented 2 years ago

my idea would to to introduce a "getBinaryValue" endoint ...

Apollon77 commented 2 years ago

The "name" topic will be fixed. binary state support is an enhancement for later