If I have data like this:
{
"zone_temps" : {
"VAV1": "read 12345:2 analogInput 2",
"VAV2": "read 12345:2 analogInput 1",
"VAV3": "read 12345:2 analogInput 1",
"VAV4": "read 12345:2 analogInput 2",
"VAV5": "read 12345:2 analogInput 1",
"VAV6": "read 12345:2 analogInput 2",
"VAV7": "read 12345:2 analogInput 1",
"VAV8": "read 12345:2 analogInput 1",
"VAV9": "read 12345:2 analogInput 2",
"VAV10": "read 12345:2 analogInput 1"}
}
Could someone give me a tip what a javascript function would look like looping over the data and recreating the data structure with same keys but the values would be in integer made from math.random()
Hopefully that makes sense, looking for a final output like this:
{
"zone_temps" : {
"VAV1": "66",
"VAV2": "88",
"VAV3": "55",
"VAV4": "66",
"VAV5": "77",
"VAV6": "67",
"VAV7": "79",
"VAV8": "87",
"VAV9": "75",
"VAV10": "71"}
}