Json function doesn't handle list of devices correctly


#1

I expected a list like: "[":97e051eb6fea489fa7cf1aaa4cb7c171:",":73d68350942e4555a8c47c36f558681e:" ,":73d68350942e4555a8c47c36f558681e:"]"

I received Expecting json(value[, format])

It seems to work correctly if there is only one device in the list. It returns only a list of one device if there are two of them and it fails with three or more.

I’m pretty sure it was suppose to work given the example on https://wiki.webcore.co/Functions#json.

I’m running this on Hubitat. WebCore v0.3.114.

Thoughts?


#2

Thanks for reporting, that is definitely a bug. @E_Sch seems like if the first argument is an array rather than an object it treats that as spreading additional arguments to the function.

Try public piston q6sqv for a simple test passing the result of Parse Json into the function.


#3

The q2sqv piston fails with the same message. Expecting json(value[, format])


#4

That’s correct, it’s meant to be a simple test case for @E_Sch to see if he can get it working.


#5

I have pushed a fix, requires user install, hpm update to get it.

let me know if it works for you.


#6

I tried using HPM but it didn’t seem to work. I installed WebCore as a built-in app. Do I need to install it from HPM to get fixes? I’ll have to manually move over some global variables, but I’m happy to do that if you think that is the solution. I’m a long time WebCore user but only six months on Hubitat.


#7

It will flow to the built-in pretty soon. I ran the test that Ian provided.

So fixes do show up first in user install, but not too long to get the built in (typically couple/few weeks)