KoenZomers / RingApi

Api in .NET 6 to communicate with the Ring Doorbell services
38 stars 19 forks source link

[BUG] Call to GetRingDevices() throws exception #20

Open JOHNEPPILLAR opened 1 year ago

JOHNEPPILLAR commented 1 year ago

Describe the bug

Throws exception when requesting devices.

Exception caught: System.Text.Json.JsonException: 'The JSON value could not be converted to System.Nullable`1[System.Int32]. Path: $.doorbots[0].battery_life | LineNumber: 0 | BytePositionInLine: 173.'

Inner exception: InvalidOperationException: Cannot get the value of a token type 'String' as a number.

To Reproduce Steps to reproduce the behavior:

  1. Login
  2. Call .GetRingDevices()
  3. See error

Expected behavior Return a list of devices.

Versions (please complete the following information):

Nickman87 commented 1 year ago

I have the same thing, ended up adding some custom converters, changing some types and even commenting out some fields just to get trough parsing the devices. Havn't fixed two properties because I did not need them for now, but apparently there are some differences in the divices depending on the country of manufacturing OR maybe the time of activation? I encoutered:

KoenZomers commented 1 year ago

If you're still interested in this, can you try it again with the latest version and share if it works now?