I'm trying to build a function where I could input some temperature value limits, that are then used else were in the project. Like I could give a number that is how low and how high temperature can get. This is for a kind of setup page in my system.
In this example I have two v-text-field elements just for testing.
I would like to send a payload with an array to the template and have my numbers update the ones that are currently in the "Range"-array. So when someone has changed those limits, the template is using the correct stored numbers.
When the user changes a value, it's then sent out using the @update function and that works. When I change the numbers, I get them out as a stings. I then have a separate function to push them trough a parseFloat. Ideally I would like them to be sent as numbers so I don't need to fix them.
How can I read in msg.payload?
How can I update the range-array with the one in the payload?
I know that the whole template should be built differently and have tried scopes and Watches and so fort, but have not found a working solution.
As a last ditch effort, I decided to try ChatGPT. And what do you know, it seem to know a lot about the issue. After couple of iterations, I was at a point where it would give me a code that can read in an array: