Describe the bug
If you use the Homebridge Plugin Setting UI to specify the device ID of a feeder (or set of feeders), it will, by default, save the value as a string to the config file. However, the HTTP response returned by the PetKit servers contains the same ID, but it is a number, and not a string. Unfortunately, in this situation, the current plugin code does not find a matching device and the plugin fails to start as a result. Simply changing the deviceId from a string to a number directly in the config file fixes the issue, but I imagine most users do not have their debug logs on to see the entire http response and may not as easily come to this conclusion.
I would recommend one of two approaches to fix this issue:
Save the deviceId as a number when setting it up via the Homebridge Plugin Setting UI
Use a fuzzy match comparison (==) when matching the deviceIDs.
Describe the bug If you use the Homebridge Plugin Setting UI to specify the device ID of a feeder (or set of feeders), it will, by default, save the value as a string to the config file. However, the HTTP response returned by the PetKit servers contains the same ID, but it is a number, and not a string. Unfortunately, in this situation, the current plugin code does not find a matching device and the plugin fails to start as a result. Simply changing the deviceId from a string to a number directly in the config file fixes the issue, but I imagine most users do not have their debug logs on to see the entire http response and may not as easily come to this conclusion.
I would recommend one of two approaches to fix this issue:
==
) when matching the deviceIDs.Detailed Information
NodeJS version: v14.16.0
Homebridge version: v1.3.4
Plugin version: v2.0.2
Example of configure(REMOVE sensitive info!):
Logs(REMOVE sensitive info and homebridge debug mode):