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
Looks like my zones (stickup cam) aren't formatted as expected. GetRingDevices() triggers an exception:
the current JSON array (e.g. [1,2,3]) into type 'KoenZomers.Ring.Api.Entities.MotionZone' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
Path 'stickup_cams[0].settings.motion_zones', line 1, position 3978.'
The offending json response looks like this: "motion_zones": [ 1, 1, 1, 1, 1 ],
I temporarily worked around it by ignoring deserialzation errors
var settings = new JsonSerializerSettings { Error = (se, ev) => { ev.ErrorContext.Handled = true; } };
var devices = JsonConvert.DeserializeObject<Entities.Devices>(response, settings);
Following your recommendation here to make the JSON parsing less strict on all returned responses from Ring to avoid the entire API not being able to be used anymore on the slightest differences. As the Ring API is not supported nor documented, it may change at any time and based on what I've seen it does do so. So this in my opinion justifies this kind of handling.
Activity
KoenZomers commentedon Dec 23, 2019
Following your recommendation here to make the JSON parsing less strict on all returned responses from Ring to avoid the entire API not being able to be used anymore on the slightest differences. As the Ring API is not supported nor documented, it may change at any time and based on what I've seen it does do so. So this in my opinion justifies this kind of handling.
Thanks for your recommendation.
Released in version 0.4.0.3