Implemented a deserializer for the battery field.
The battery field needs to be able to handle when the JSON field for it is null.
Because when a toy connects, Lovense Connect will send null in the battery field
until the toy has been fully initialized im guessing?
In my opinion Lovense Connect should just send 0 instead of sending null when a toy isnt fully initialized.
However the bug behaviour is:
1. Connect a ButtplugClient
2. Start Lovense connect
3. Connect toy to Lovense Connect
4. Call ButtplugClient::start_scanning()
5. The json deserialization will fail and will not parse the incoming connected toy.
6. Scan again and you will get the battery number.
authored by
qdot.tngl.sh
5aa44a15
48d2a7d2