My binding has a need to configure a decimal value with 6 decimals precision, but the input field only allows 2 decimals. After examining the code (not really fluent in js, and not familiar with vue so may have looked in the wrong place), the step parameter in the config-description should be what's decides the precision, otherwise it defaults to step="0.01". I set this to 0.000001, but nothing changes. When I inspect the response to /rest/config-descriptions/{thing-typeUID} however, the parameter is not called step, but stepsize. Might this be what's causing the issue?
<config-description uri="thing-type:smhi:forecast">
<parameter name="latitude" type="decimal" step="0.000001" required="true">
<label>Latitude</label>
<description>Latitude for the forecast</description>
</parameter>
...
</config-description>
Expected behavior
The input field validates according to the step parameter in the config-description.
Steps to reproduce
Install the SMHI-binding
Note: The binding included in the distribution doesn't include the step parameter in the config-description, so need to be built from the source-code at my github repo
Response from /rest/config-descriptions/smhi:forecast (channels omitted):
{"configParameters":[{"description":"Latitude for the forecast","label":"Latitude","name":"latitude","required":true,"type":"DECIMAL","stepsize":0.000001,"readOnly":false,"multiple":false,"advanced":false,"verify":false,"limitToOptions":true,"options":[],"filterCriteria":[]},{"description":"Longitude for the forecast","label":"Longitude","name":"longitude","required":true,"type":"DECIMAL","stepsize":0.000001,"readOnly":false,"multiple":false,"advanced":false,"verify":false,"limitToOptions":true,"options":[],"filterCriteria":[]},{"description":"The hourly forecasts to display","label":"Hourly Forecasts","name":"hourlyForecasts","required":false,"type":"INTEGER","readOnly":false,"multiple":true,"advanced":false,"verify":false,"limitToOptions":true,"options":[{"label":"Current hour","value":"0"},{"label":"Next hour","value":"1"},{"label":"2 hours from now","value":"2"},{"label":"3 hours from now","value":"3"},{"label":"4 hours from now","value":"4"},{"label":"5 hours from now","value":"5"},{"label":"6 hours from now","value":"6"},{"label":"7 hours from now","value":"7"},{"label":"8 hours from now","value":"8"},{"label":"9 hours from now","value":"9"},{"label":"10 hours from now","value":"10"},{"label":"11 hours from now","value":"11"},{"label":"12 hours from now","value":"12"},{"label":"13 hours from now","value":"13"},{"label":"14 hours from now","value":"14"},{"label":"15 hours from now","value":"15"},{"label":"16 hours from now","value":"16"},{"label":"17 hours from now","value":"17"},{"label":"18 hours from now","value":"18"},{"label":"19 hours from now","value":"19"},{"label":"20 hours from now","value":"20"},{"label":"21 hours from now","value":"21"},{"label":"22 hours from now","value":"22"},{"label":"23 hours from now","value":"23"},{"label":"24 hours from now","value":"24"}],"filterCriteria":[]},{"description":"The daily forecasts to display","label":"Daily Forecasts","name":"dailyForecasts","required":false,"type":"INTEGER","readOnly":false,"multiple":true,"advanced":false,"verify":false,"limitToOptions":true,"options":[{"label":"Today","value":"0"},{"label":"Tomorrow","value":"1"},{"label":"2 days from now","value":"2"},{"label":"3 days from now","value":"3"},{"label":"4 days from now","value":"4"},{"label":"5 days from now","value":"5"},{"label":"6 days from now","value":"6"},{"label":"7 days from now","value":"7"},{"label":"8 days from now","value":"8"},{"label":"9 days from now","value":"9"}],"filterCriteria":[]}],"parameterGroups":[],"properties":{},"extensibleChannelTypeIds":[],"UID":"smhi:forecast","label":"SMHI Weather Forecast","description":"Gets weather forecasts from SMHI","listed":true,"supportedBridgeTypeUIDs":[],"bridge":false}
After updating my production system to 3.0 I noticed this issue is still present. The thing-type configParameters have stepsize: 0.000001, but the input element still have it set to 0.01.
The problem
My binding has a need to configure a decimal value with 6 decimals precision, but the input field only allows 2 decimals. After examining the code (not really fluent in js, and not familiar with vue so may have looked in the wrong place), the step parameter in the config-description should be what's decides the precision, otherwise it defaults to step="0.01". I set this to 0.000001, but nothing changes. When I inspect the response to
/rest/config-descriptions/{thing-typeUID}
however, the parameter is not calledstep
, butstepsize
. Might this be what's causing the issue?Html for the generated input-field:
Config-description:
Expected behavior
The input field validates according to the step parameter in the config-description.
Steps to reproduce
Your environment
Browser console
Browser network traffic
Response from /rest/config-descriptions/smhi:forecast (channels omitted):
Additional information