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
When defining a parameter as <parameter name="parameterName" type="integer" multiple="true"> in the xml-file the resulting multiple selection input doesn't display which values are checked when editing a Thing. I believe the reason is that the config-description returns the values as strings, but the thing definition returns them as numbers, which breaks the comparison. This can be seen in the config YAML: if you check some of the options, they appear in the YAML config as string representations of the numbers, but when the thing is loaded from the rest api they appear as numbers. Obviously, only strings work for html inputs, and they can be parsed to create the Thing correctly, but when the Thing is loaded for editing, the values are returned as numbers, and need to be converted to strings to make the comparison work and set the checked-value of the option correctly.
Expected behavior
The configured values appear as checked boxes when editing a Thing with a multiple-selection list.
Steps to reproduce
Install the SMHI-binding
Create a new Forecast thing, and check some of the values for Hourly forecasts and/or Daily forecasts
The YAML would look something like this:
The problem
When defining a parameter as
<parameter name="parameterName" type="integer" multiple="true">
in the xml-file the resulting multiple selection input doesn't display which values are checked when editing a Thing. I believe the reason is that the config-description returns the values as strings, but the thing definition returns them as numbers, which breaks the comparison. This can be seen in the config YAML: if you check some of the options, they appear in the YAML config as string representations of the numbers, but when the thing is loaded from the rest api they appear as numbers. Obviously, only strings work for html inputs, and they can be parsed to create the Thing correctly, but when the Thing is loaded for editing, the values are returned as numbers, and need to be converted to strings to make the comparison work and set the checked-value of the option correctly.Expected behavior
The configured values appear as checked boxes when editing a Thing with a multiple-selection list.
Steps to reproduce
The YAML would look something like this:
The thing gets created correctly
3. Open the thing to edit the configuration. No values are checked, and the YAML look like this:
Your environment
Browser console
Browser network traffic
Example config-description:
Example thing definition config:
Additional information
Please also have a second look at #643 which also relates to the configuration of this binding, and wasn't resolved bu the suggested fix.
The text was updated successfully, but these errors were encountered: