You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe. util/endpoint-context.js includes several "config value" retrieval methods, which are very handy, but they only pull out the first value in the array. For arrays larger than 1, you are out of luck.
Describe the solution you'd like
I have thought of several use cases that these needs to support:
1. Raw data
you are building a config page and you want a list of the raw values in an array
e.g., deviceId, or modeId, etc.
2. Building strings with label/name
you are building a config page and you want to use the device Ids as a template
e.g., setting the description as Light Bulb 1, Light Bulb 2, Rear door lock
this cannot be done because you have no API access token to look up the labels, so Strongman can replace values
Strongman sees the literal string {{deviceId:81e3bbf5-b63e-4c18-af21-51f72520fe40}} and it will transform it into Light Bulb 1
IMHO, the responsibility of the function should be to:
Return a singular string value, or to return an array of strings
Not assume the user wants to do anything in particular with those strings
Take flexible arguments:
you pass in a string argument, it finds that value and returns the un-templated value
you pass in an object like { name: 'modes', templated: true }, then it returns the templated value (it would also respect if you sent false)
Is your feature request related to a problem? Please describe.
util/endpoint-context.js
includes several "config value" retrieval methods, which are very handy, but they only pull out the first value in the array. For arrays larger than 1, you are out of luck.Describe the solution you'd like
I have thought of several use cases that these needs to support:
1. Raw data
2. Building strings with label/name
Light Bulb 1, Light Bulb 2, Rear door lock
{{deviceId:81e3bbf5-b63e-4c18-af21-51f72520fe40}}
and it will transform it intoLight Bulb 1
IMHO, the responsibility of the function should be to:
{ name: 'modes', templated: true }
, then it returns the templated value (it would also respect if you sentfalse
)Proposed usage
Describe alternatives you've considered
n/a
Additional context
n/a
The text was updated successfully, but these errors were encountered: